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


ADVERTISEMENT

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 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

General :: Can I Force Nohup Output To Screen Instead Of A File

Nov 9, 2010

When I run a script with nohup, the output is forced to the out.log file by default; is there a way to force the output to the screen instead of the file? I need to be able to see when my script gives me a "process started" message, and I don't want to clog up the system with log files.

View 2 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

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 :: 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

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 :: Get The Output Of Script To Both Screen And File By Just Executing Name Of The Script?

Jun 2, 2011

I have a script, I am able to send the output of the script to both the screen and a file as shown below

Code:

./script | tee -a temp.log

I wonder is it possible to achieve same thing by executing some commands inside the script. As for other users, who execute the script it is not advisable to pipe the output of script with the help of tee command. Again, keeping |tee at the end of every line of the script doesn't seem to be advisable. I tried with this for couple of lines and it works. Is it possible to get the output of script to both screen and file by just executing name of the script, with some script tweaking ?

View 4 Replies View Related

Ubuntu :: Cat Displays The Output Of A File On The Screen?

Jul 22, 2010

1)what is the diff between echo and cat. cat displays the output of a file on the screen. dont echo does about the same?

2)Can anyone explain this command to be? sh -c " echo 'export XMODIFIERS=@im=SCIM ; export GTK_IM_MODULE="scim" ; export QT_IM_MODULE="scim" ; scim -d " > /etc/X11/Xsession.d/95xinput"

View 2 Replies View Related

Programming :: Awk: Print Out A Message To The Screen When Redirecting The Output To File?

Mar 15, 2010

I have a problem when using awk:

e.g: awk '{processing text}' File1 > File2

But when I'm processing the File1, I want to print out some messages to the screen (not the File2). How can I do that?

View 5 Replies View Related

Software :: Redirect ALL Terminal Output To File And Screen (for Entire Session)?

Jul 6, 2010

Is there one command that will let me record an entire terminal session (with any possible errors) to a text file while also seeing all output on screen too? I know it can be done for individual commands, but I'm looking to do this for an entire session where the individual commands will be normal (i.e., not piped into tee, etc.). It would be even better if the command prompt is captured too. The obvious utility of this makes me think someone surely has come up with a solution long ago (probably in the 60's).(I'm sure it goes without saying, but subsequent output in that session should be appended to the file. The file should contain the full history, with all output and errors, of the session.)

View 9 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

Programming :: Use Regex In Perl Script To Detect Allowed Words From The File And Then Print Output To The Screen?

Oct 4, 2010

Its my first post in here so please be patient I am trying to use regex in perl script to detect allowed words from the file and then print output to the screen.

As an example : I have text file with orders and returns :

Item2-SKU-2-11.08.2010-online
Item3-SKU-3-11.09.2010-return
Item4-SKU-4-11.09.2010-store

My question: is it possible to make sure that i am ony outputing to the screen orders based on few conditions like Item,order form e.g. online.And is it possible to have multiple matches (Item2 only diplay if ordered online etc)

View 1 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 :: 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 :: Script To Ftp A File To Remote Machine - Log The Output To A File?

Feb 5, 2010

I am using below script to ftp a file to remote machine

Code:

#!/bin/bash
ftp -nv <<EOF
open ${SERVER}

[code]....

When I execute the above file its working fine and displaying output on to the screen. How can I log the output to a file?

View 7 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 :: Get Output File From A Master File?

Aug 3, 2010

having following problem in linux environment.I have a following basic file with name " BASEFILE", as shown example below :

sl.no pol.no name status loan
1 123 rama FORCE 500
2 234 jama LAPSE 800

[code]...

View 12 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

General :: Send And Receive File Through Minicom?

Mar 30, 2010

I have setup CentOS as server and Fedora as Client.Now I want to transfer file from server to client through minicom.How to do that?I tried sending file from CentOs and it does have a ASCII format file transfer option while on the other OS only few like xmodem , ymodem and zmodem type of file transfer was present.

View 2 Replies View Related

General :: Send A File Using The Sftp Syntax

Mar 24, 2011

I understand how to get a file from an another computer using the sftp syntax

So i can get the file abc from comp2 to comp1

But how can I send a file cba from comp1 to comp2 using the sftp(I am still using comp1)

View 2 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

General :: Script To Send A File To Yahoo Or Gmail Id?

Mar 5, 2010

I want to mail a file to my yahoo or gmail id.is there any script or any possibility to do this.i have mail day to day server performance to my mail id in form of a text file.is this possible???

View 2 Replies View Related

General :: Getting The Name Of The Output File?

Nov 2, 2009

have a doubt, suppose in the script i include an exe type of file for ex. ./a.out, which takes input as a pdb file namely 1sn3.pdb, now i want my output text file to contain the name 1sn3.txt , how do i do that using the shell script

View 8 Replies View Related

General :: Send A File From The IRDA To A PDA Using IROBEX Protocol +commandline

Mar 11, 2010

Is there a simple command line to do this, in an easy way?

View 1 Replies View Related

General :: Mutt Didn't Send Email Via .sh File After Reboot?

May 14, 2010

I restarted a server yesterday for the first time in 2 years, but a shell script that send out an email every night via a mutt command line didn't work last night.

I don't know anything about mutt. do i have to start something in order for it to be able to work? is there a log i can look at to see what did or didn't happen making it not work?

View 4 Replies View Related

General :: Saving Awk Output To File?

Feb 2, 2010

I have a problem with saving output from awk to a file. The commands I tried:

Code:

$ top | awk '/Cpu|Mem/ {if ($1 ~ /Cpu/) {printf strftime("%H:%M:%S")" "; printf strtonum($3)" ";} if ($1 ~ /Mem/) {printf ($5/$3)*100; printf "
";}}' > file.out

and

Code:

$ top | awk '/Cpu|Mem/ {if ($1 ~ /Cpu/) {printf strftime("%H:%M:%S")" "; printf strtonum($3)" ";} if ($1 ~ /Mem/) {printf ($5/$3)*100; printf "
";}}' &> file.out

In both cases file.out is empty. What am I doing wrong?

View 2 Replies View Related

General :: Using The Expect And Send To Execute List Of Commands Inside A File?

Feb 2, 2011

i am working on some kind of PBX and i have list of telephone numbers inside a file, i have to insert these numbers into the correct command and then telnet to a remote server and execute these commands. i can read the telephone numbers and insert them into the command with no problem, but when i try to insert these commands into the send i face problem. here is the basic code

#!/bin/bash
read msisdn < input
string="ZZZZ:MSISDN=$msisdn;"

[code]....

i can make external loop inside the Bash which read the input file and issue the command and then telnet and execute, but this will make the script connects and disconnects again for each line which cause high load on that server and hardwar problem. i am wondering if there is an option inside the expect interperter which makes the send read directly from a file... somthing like this:

expect "<"
send "input-filename
"
expect "<"
expect eof

View 1 Replies View Related







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