10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am struck up with a problem and that is with output redirection.
I used all the ways for the redirection of the output of c binary to a file, still it is failing.
Here are the different ways which I have used:
./a.out | tee -a /root/tmp.txt 2>&1
./a.out | tee -a /root/tmp.txt 1>&1
./a.out |... (2 Replies)
Discussion started by: Maya29988
2 Replies
2. Shell Programming and Scripting
Hi
I am making a script where i want to redirect the output of ls -l to a file
Example
#ls -l fil1.txt > /opt/temp/a.txt
ac: No such file or directory
I want to capture output of this command
like here output is
ac: No such file or directory
can anyone help (4 Replies)
Discussion started by: anish19
4 Replies
3. Shell Programming and Scripting
I need to count the number of lines in a .txt file and put it in a variable.
I am using the following code
#!/bin/bash
count = $(wc -l "some file.txt" | awk '{print$1}')
echo $count
It is giving the following error.
line3: count: command not foundWhat am I doing wrong here? :confused: (7 Replies)
Discussion started by: haritha.gorijav
7 Replies
4. Shell Programming and Scripting
So I have a existing file that I used the uniq command on and I need to save the output to the same file without changing the file name.
I have tried $ uniq filename > filename
then when I cat the file it then becomes blank like there is nothing inside.
any help would be much appreciated... (0 Replies)
Discussion started by: drew211
0 Replies
5. Shell Programming and Scripting
Hello everyone,
My requirement is that within a script I need to construct the command line exactly that it was invoked with. For example :
sh a.sh arg1 arg2 arg3 < input.txt > output.txt
Now within a.sh, I construct a file which has these contents "
sh a.sh arg1 arg2 arg3 < input.txt >... (8 Replies)
Discussion started by: hedonist12
8 Replies
6. Shell Programming and Scripting
Hi there
I have a script that runs but it outputs everything onto the screen instead of a file.
I've tried using the > outputfile.txt however all it does is dump the output to the screen and creates an outputfile.txt but doesn't put anything in that file.
Any help would be appreciated
... (6 Replies)
Discussion started by: kma07
6 Replies
7. Shell Programming and Scripting
Hi Guys,
I have a script for which the stdout and stderr should be redirected to a log file, they should not be printed on the screen. Could you please let me know the procedure to redirect the output of the script to a log file. Thanks in advance.
--- Aditya (5 Replies)
Discussion started by: chaditya
5 Replies
8. Shell Programming and Scripting
I'm redirecting the output of a command to a logfile, however, if the user is on a terminal I would also like the output to be displayed on the screen.
tar tvf some_tarfile >Logfile
if the user is on a term then have the output to the Logfile and also be displayed on the screen at the same... (2 Replies)
Discussion started by: nck
2 Replies
9. Shell Programming and Scripting
Hi all,
Actually i need to know whether there is any way to redirect the output of shell operations into any file without pipe .
Actually my problem is , i run some command & its result is displayed on shell after some calculations on shell, so if i redirect its output to file, it is not... (5 Replies)
Discussion started by: sarbjit
5 Replies
10. Shell Programming and Scripting
Hi,
Can anyone please tell me what these lines do?
ls >& outfile
ls outfile 2>&1
Thanks. (1 Reply)
Discussion started by: trivektor
1 Replies