General :: Send The Output Of Send Command To A File?

Jan 20, 2011

in the middle of script, i need to send the output of (send command on line 8) to a file

#!/usr/bin/expect
spawn telnet 172.20.64.133
expect "ENTER USERNAM <"

[cod]....

i treid the below on line 8 :

1- send "show command;

" > logfile.txt : gives an error extra character after the "

2- logsave logfile.txt 'send "show command;

" ': error invalid command

3- i simply tried to send the output of the whole script to file logsave /home/logfile ./script : seems that logsave work under root only

4- ./script > logfile : the problem with this is that the output of echo or (read "enter your id") command will not be displayed on the screen (actually nothing will be displayed, i have to open the log file to see the output). is there any way to save the log of the "send" ? or to save the log of the complete script without hiding the output on the screen?

View 2 Replies


ADVERTISEMENT

General :: Make A Script To Send Output Of Top Command In Mail?

Mar 4, 2010

How can i make a script to send the output of top command in mail.
i have to mail the output to another person , tell me how can i do this

View 3 Replies View Related

General :: Send Output To Both The Screen And A Txt File?

Jan 29, 2010

I am currently using this command

Code:

apt-get install samba --force-yes -y > /sambainstall.txt This suppresses the screen output and sends it all to a text file, how do I have both?

View 2 Replies View Related

General :: Data From Input File To Be Taken And Send To Output File?

Jul 24, 2010

I am new to shell scripting.What i am trying is to write a shell script which take the input file and output should like as mentioned below.Output file should have data till SOK (marked in red)from every second line and then the selected data(marked in green) from 4th line.So selected data from 2nd and 4th line in one line of O/P file and then similarly selected data from 6th and 8th line in second line of O/P file.Input File:

3c3
< c1111;11.11.11.11;pOK;SOK:abcde;Universe:aa
---

[code]...

View 14 Replies View Related

Programming :: Send The Output Of A Command In A File Defined By A Eval $"$var1"?

Jul 7, 2010

Here is the block of code : (The red part is the code that doesn't work) The file is not created and see the output after the code. # i loop create environment structure and k loop create std procedure sub structure.

for i in TRAX2 TRAX BENCH PROD
do
eval mkdir $"acsayul02501_${i}"
eval chmod 2770 $"acsayul02501_${i}"

[code]....

View 3 Replies View Related

General :: Unix Command To Send File To Printer?

Mar 28, 2010

Is it true that the UNIX commands to send a file to a printer for printing are system-dependent?

View 2 Replies View Related

General :: Send A File From One Computer To Another By Command Line?

Jan 27, 2010

I've got a Debian Squeeze computer on which the graphics have packed up, but the terminal in single user mode work perfectly fine.

There are a few files on this Debian computer that I want to transfer off, to a networked computer, but I have no idea how to do this.

The destination computer is a freshly re-setup Mandriva install, without (as yet) samba. I don't think it's necessary though. The Mandriva install works fine, has graphics, etc, but can't see the Debian Squeeze computer on the network, possibly because it's in single user mode, thus prompting the problem of how to transfer the files, using only a command line.

View 6 Replies View Related

Programming :: PyGTK: Send Output From A File Descriptor To A Textview?

Jul 22, 2010

Within PyGTK I'm using gobject.spawn_async to launch a bash script. I would like the output of that bash script to be displayed within my application. I have a textview set up to receive the text ...

Here are the commands that launch the program:

Code:
def run_command(command):
global keep_pulsing
keep_pulsing=True
(cpid, cstdin, cstdout, cstderr) = gobject.spawn_async(command,flags=gobject.SPAWN_DO_NOT_REAP_CHILD|gobject.SPAWN_STDERR_TO_DEV_NULL,standard_code....

Here are the two callback functions. But like I say ... I have no idea how to get that data from the 'cstdout' file descriptor into a textbuffer.

Code:
### THE FOLLOWING ARE GLOBALS:
textview = wTree.get_widget('textview1')
textbuffer=textview.get_buffer()
def update_textview_callback(fd, condition):
global keep_pulsing
if keep_pulsing:
progressbar.pulse()
code....

View 3 Replies View Related

Ubuntu Servers :: Use The Mail Command Line Program To Occasionally Send Log Output To Email Aliases?

Jan 27, 2011

Can anyone tell me what the pros and cons are between heirloom-mailx vs mailutils? This is for ubuntu 10.04 LTS. AT this point my only purpose is to use the mail command line program to occasionally send log output to email aliases.

View 2 Replies View Related

General :: How To Send Colored Output Of Shell Script As Email

Feb 24, 2011

Regarding this task, I am able to print colored output in my putty sessions using tput or ASCI codes but whenever I tried to send that output through mail command to my outlook maillox, It always goes without colored. I need to produce those coloured output of the scripts as it is in mail.

View 1 Replies View Related

General :: How To Send Command To Daemon

Jan 20, 2011

I have a minecraft server running as a daemon. When you run it normally (not as a daemon), you can type commands into the console. How can you get to the console so I can send it commands while it's running as a daemon?

View 1 Replies View Related

General :: Particular Command To Send Different Signals?

Mar 10, 2010

We all know how to kill multi process but if we want to send different signals to different process like to stop,-9,to hungup simultaneously at the same time then how we will do it,is there any particular command to do it.

View 1 Replies View Related

General :: Net Send Command In Linux

Dec 20, 2010

hope you will know the net send command of windows.in the same way we are working on linux red hat 5.0 we want to know the equivalent command of net send for linux if any body know then please tell us? we are here only when we not found on google so please do not give the suggestion of searching on google.

View 5 Replies View Related

General :: Send Enter Command To Screen ?

Apr 5, 2011

I'm currently writing a C++ application to manage some screen functions in Debian(server).

However this issue have bothered me for 2 days now...

What I want to do is to send a command to an attached screen which is running.

Used the following command: Code: screen -S screenwindow So I send a command with the -X parameter, which works just fine... Code: screen -S screenwindow -X stuff yes The command I want to send is "yes" and it does appear in my screen window when I attach it.

But the problem is that I need it to submit it... well I need to press "enter" and I've been looking everywhere on how to do that.

Because right now it hangs on a line like this: Code: Something here, do you want bla bla: yes Obviously I could just press enter myself, but the problem is that it's running as a deamon and but it is supposed to do this all by itself .

So are there any way I can submit it?

View 4 Replies View Related

General :: Configure The At Command To Send To Someone Other Than Root?

Jul 6, 2010

Is there a way to configure the at command to send to someone other than root?

View 1 Replies View Related

General :: [Bash] Send Command To Another Terminal?

Sep 10, 2010

I open up 2 xterms on my desktop, A(/dev/pts/0) and B(/dev/pts/1).I can write from A to B using redirection e.g. echo "test" > /dev/pts/1How do I run a command from A on B? e.g. "clear"Basically I'm putting the 2 terminals side by side, and using terminal B to display the contents of the current working directory, by running the following in A:export PROMPT_COMMAND="ls -a > /dev/pts/1"but this fills up the screen pretty fast. I was actually looking for a way to clear up the second terminal.

View 6 Replies View Related

General :: Send Email From Command Line?

Mar 2, 2011

I'm looking for an easy way to send basic emails for the command line. I have tried configuring sendmail and mailx, but I have yet been able to receive a test email at my remote address. I have read through a fair amount of "how to" on this but I am a little confused and obviously not doing something right. My sendmail.mc file is as follows

Code:
divert(0)dnl
VERSIONID(`$Id: generic-linux.mc,v 8.1 1999/09/24 22:48:05 gshapiro Exp $')
OSTYPE(linux)dnl
DOMAIN(generic)dnl
MAILER(local)dnl
MAILER(smtp)dnl

When I try to send a test mail via

[Code]....

View 14 Replies View Related

General :: Send Command To Another User's Screen Terminal

Mar 22, 2011

I have two users; user1 and user2. I have a bash script run by user1, that needs to run a command on a screen terminal started by user2.

View 1 Replies View Related

General :: Failing To Send Mail From Command Line?

Mar 16, 2010

I am using Ubuntu 9.10 and when I tried to send mail from the command line I get: /usr/lib/sendmail: Permission denied. any takers on this.

View 6 Replies View Related

General :: Send A Message In RHEL4 ES Thru Command Prompt?

Mar 18, 2010

I am working on RHEL4 ES server. In our system Talk is not activated(i did not find it in services). To send a mail thru web based mail it is time taking process. I want to send a message(or a mail) to other server. How can I do this? Example: my server IP is 10.xx.xx.xx and the other is 10.xx.xx.xx

View 1 Replies View Related

General :: Send Internal Email Using The Mail Command?

Jun 3, 2009

Send an E-mail to your local account. Try two different ways to send and read it. How can you check that it really arrived? I decided to try using the 'mail' and 'pine' commands. So:

1) Using the root account, intending to send an e-mail to myself (root):

Code:

# mail -s "Hello root!" root
Simple form of sending e-mails internally.
^D (this keystroke is to finish the e-mail)
EOT

2) Using 'pine', another e-mail client: The mail is composed correctly, with 'To:' field set to:

Quote:

[URL]

which is my hostname, as my box runs in a VMWare Slack 12.2 image. In both cases, nothing was received in my mailbox (by typing #mail)... Additionally I don't see any new e-mails when I look at the file '/var/spool/mail/root'. Do I need extra information configuring my mail client/server/service?

View 6 Replies View Related

Fedora :: Sendmail - Setup To Send / Send Emails With It?

Aug 17, 2011

I'm writing a script that will send an alert email given certain conditions. I have the impression that sendmail is what I need to do that. I just don't know how to use sendmail at all. I assume I have to set it up like a typical mail client so that it has a mail server to log into to send from.

I've looked through the man pages, but I can't find anything in plain English there on how to set it up, or how to use it once it is set up.

View 14 Replies View Related

General :: Send With Ftp Files From Computer1 To Computer2 (shell Command)?

Jun 29, 2010

I have 2 computers with linux, How can i send with ftp files from computer1 to computer2 them(shell command)? Steps that i think should be done (miss shell commands): find inner ip of computer1 open the ftp port (21) of computer1 (make computer1 ftp server) send file from computer2 to computer1 with shell command

View 2 Replies View Related

General :: Send Gpg Encrypted Mail Automatically From The Command Line?

Sep 14, 2010

How can I send gpg encrypted mail automatically from the linux command line?

I'm a little stumped on this one, I've tried using mutt but it doesn't encrypt mail unless it's used interactively.

Does anyone know if you can use the build in mail command to do this some how?

View 1 Replies View Related

General :: Send Email With Attachment By Postfix From Command-line?

Dec 11, 2010

I've just setup a new Ubuntu 10.04 LTS server on linode for myself. Followed an excellent instruction at: here to finish the installation of some basic stuff including postfix.

I am trying to figure out a way to send an email to my gmail address with an attachment, but cannot find how. Already confirmed that email can reach my gmail account.

In the end I have to use mutt to send the email with attachments, probably SendEmails will also do well, but I am wondering how to do the same thing in postfix from command-line?

View 3 Replies View Related

General :: Include Command Results To Send To Admins Via Mail

Jul 16, 2010

how to include my command results in a script? Basically what the script does is it checks the status of a service within the linux server, then sends an email when done. I want to include the results of my status check to my mail when sent.

i.e.
service dhcp3-server status Status of DHCP server: dhcpd3 is running. <---this I want to include in the mail that is sent out via script.

View 6 Replies View Related

General :: Script To Monitor Port For Active, Then Send Command?

Mar 28, 2010

I need a script that would continuously monitor one port and when it is active (not listening or waiting) execute a series of commands to standard output.I am familiar with netstat but am not good with scripting so

View 15 Replies View Related

Programming :: Send A Mysql Query Output Into An Array?

Jul 27, 2010

i will be quick, im trying to send a mysql query output into an array ie:

Code:
declare -a HD
HD=`echo "USE db; SELECT uid FROM user" | mysql -u $login -p$pwd -h $dbhost -B`
echo ${#HD}
those vars in mysql connection are previously and correctly assigned.
but got an error

script.sh: 2: declare: not found

View 3 Replies View Related

General :: Windows - Send The Same Audio Output To Two Audio Devices?

Aug 23, 2010

Say I have 2 speakers connected to 2 different sound cards. Under Windows, is it possible to have some sort of virtual device that would forward an audio stream to both sound cards? If this can't be easily done under Windows, a solution for Linux is also fine. lternatively, if the 2 speakers are connected to different channels of a sound card, is there any vendor-independent way to duplicate audio to both channels?

View 1 Replies View Related

General :: How To Send A Large File Securely

Aug 28, 2011

I need to send large files from a Linux machine to another using cryptography. The sender machine knows the recipient IP but not vice-versa. I don't need strong cryptography and prefer higher-speed less-secure solutions.

There are no problems with presharing crypto keys but I'd prefer not dealing with SSH users creation.

I think to HTTP PUT over TLS, but I never had experience with it and I prefer to hear which are the possible solutions. I know that it can listen as a daemon but I don't know anything about cryptography. So pipeing with OpenSSL may be a solution.

View 2 Replies View Related







Copyrights 2005-15 www.BigResource.com, All rights reserved