Redirect the output in shell script for tftp


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Redirect the output in shell script for tftp
# 1  
Old 05-17-2011
Redirect the output in shell script for tftp

I've been using tftp in one of my file

Code:
#!/bin/bash
filename1="config1h.txt"
filename2="config15.txt"
hostname="test.com"
tftp $hostname <</dev/null
get $filename1
get $filename2
quit
EOF

My output looks like this
Code:
[root@sys Script]# ./test3.sh
tftp> Received 1262 bytes in 0.0 seconds
tftp> Received 190 bytes in 0.0 seconds
tftp> [root@sys Script]#

Now i dont need the tftp output to be printed to the screen. I want to redirect to some temp file.

Moderator's Comments:
Mod Comment Please start using [CODE] tags when posting source, console output, listings, ...

Last edited by pludi; 05-17-2011 at 11:14 AM..
# 2  
Old 05-17-2011
Try this

Code:
./test3.sh >/dev/null 2>&1

Code:
./test3.sh >/tmp/log.txt 2>&1

regards,
Ahamed
# 3  
Old 05-18-2011
I dont want the whole script to be redirected to some log file. Only the tftp portion i wanna redirect that too inside the script and not while executing the script
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Redirect script output to file after grep

i have simple program that generate log file 1 line every sec, i need to do grep for specific record then redirect to another file. #!/bin/bash for i in `seq 1 20`; do echo $i sleep 1 done ./test.sh |egrep "5|10|15" 5 10 15 r ./test.sh... (2 Replies)
Discussion started by: before4
2 Replies

2. Shell Programming and Scripting

Redirect script output to a file and mail the output

Hi Guys, I want to redirect the output of 3 scripts to a file and then mail the output of those three scripts. I used below but it is not working: OFILE=/home/home1/report1 echo "report1 details" > $OFILE =/home/home1/1.sh > $OFILE echo... (7 Replies)
Discussion started by: Vivekit82
7 Replies

3. Programming

How to redirect the output of a shell script to a file?

hi, i have a html form which call a perl program, this perl program calls a shell script. <html> <head> <title>demo</title> </head> <body> <form name="frm1" action="/cgi-bin/perl_script.pl" method="post"> <input type="text" name="fname"> ... (1 Reply)
Discussion started by: Little
1 Replies

4. Shell Programming and Scripting

script to mail monitoring output if required or redirect output to log file

Below script perfectly works, giving below mail output. BUT, I want to make the script mail only if there are any D-Defined/T-Transition/B-Broken State WPARs and also to copy the output generated during monitoring to a temporary log file, which gets cleaned up every week. Need suggestions. ... (4 Replies)
Discussion started by: aix_admin_007
4 Replies

5. Solaris

Script redirect command output failed, why?

Hi, I put a for loop in a script to eject backup tapes from the robot. The command echo' output goes to the log file without problem, but command vmchange's output does not go to the log file although it's working fine. It still displays on the screen. I've tried '2>&1 1>$log', but nothing changed.... (5 Replies)
Discussion started by: aixlover
5 Replies

6. Programming

Redirect input and output to a shell script?

Dear All: I am trying to do something that (I thought) was relatively straightforward, but my code snippet does not seem to work. Any suggestions? Thank you Sincerely yours Misha Koshelev #include <stdio.h> #include <stdlib.h> #include <unistd.h> #include <errno.h> #include... (0 Replies)
Discussion started by: misha680
0 Replies

7. Shell Programming and Scripting

Redirect bg process output to within the script

Hi, I have a process running in the background, which throws up some output to the terminal when I run my script. How can I read this output from my script? Thank you. (5 Replies)
Discussion started by: Theju
5 Replies

8. Shell Programming and Scripting

how to redirect the output of a grep command to a file inside a shell script

hi, i wat to get the output of a grep command in a file. but when i am trying out the same grep command in the unix prompt its working fine.. i am getting the output properly.. but when i am writing the same command inside my shell script , its just creating a new output file with no contents... (11 Replies)
Discussion started by: kripssmart
11 Replies

9. Shell Programming and Scripting

Script that Redirect SSH output via cron

Hi, I have a script that's being called via a crontab which is a wrapper script that creates a log for the script that gets executed. Within the script that gets executed, it also run's subscripts. I've been able to get everything to work .. but the issue is one of the subscript that goes out... (4 Replies)
Discussion started by: primp
4 Replies

10. Shell Programming and Scripting

awk redirect output to shell variable

I'm trying to redirect awk's output to a BASH variable. Currently the statement looks like this options=`awk '{ while (i < NF) { print $i; ++i } }' answer but for some reason that makes $options look like this: 1 2 3 4 1 2 3 Now, the input file 'answer' is taken from a dialog... (3 Replies)
Discussion started by: dhinge
3 Replies
Login or Register to Ask a Question