write a command

Post new topic   Reply to topic

View previous topic View next topic Go down

write a command

Post  Admin on Sat Sep 06, 2008 5:03 am

How can I arrange to have output go two places at once,
e.g. to the screen and to a file? give a command for this?

Admin
Admin

Posts: 39
Join date: 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

Re: write a command

Post  goldberg on Sat Sep 06, 2008 11:26 am

cat | cat > file will result in input going to stdout as well as filenamed file

goldberg

Posts: 8
Join date: 2008-08-11

View user profile

Back to top Go down

Re: write a command

Post  Admin on Sat Sep 06, 2008 12:41 pm

dear gold berg just try it the command you have written on shell is it working .........
if you have not understand the question please ask me.......... Very Happy

Admin
Admin

Posts: 39
Join date: 2008-08-03

View user profile http://computerclub09mnnit.forumotion.net

Back to top Go down

OOPS

Post  goldberg on Sat Sep 06, 2008 5:16 pm

Sorry I misinterpreted the question
I will try it if possible
Actually what I wrote will first ask me for Input(simultaneously write it to screen) and then just copy what I wrote to the file
(Please Correct me if I am still wrong)

goldberg

Posts: 8
Join date: 2008-08-11

View user profile

Back to top Go down

Correct Answer

Post  ankitgr8 on Sun Sep 07, 2008 2:13 pm

Suppose u wish to see the output of 'who'
who | tee file

ankitgr8

Posts: 6
Join date: 2008-08-11

View user profile

Back to top Go down

Re: write a command

Post  Gyanendra on Sun Sep 07, 2008 2:21 pm

who|tee file1 file2> /dev/tty

Gyanendra

Posts: 8
Join date: 2008-09-07

View user profile

Back to top Go down

View previous topic View next topic Back to top


Permissions of this forum:
You cannot reply to topics in this forum