10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Sed command to replace a line in a file using line number from the output of a pipe.
Is it possible to replace a whole line piped from someother command into a file at paritcular line...
here is some basic execution flow..
the line number is 412
lineNo=412
Now i have a line... (1 Reply)
Discussion started by: vivek d r
1 Replies
2. Red Hat
I ran the following command.
cat abc.c > abc.c
I got message the following message from command cat:
cat: abc.c : input file is same as the output file
How the command came to know of the destination file name as the command is sending output to standard file. (3 Replies)
Discussion started by: ravisingh
3 Replies
3. Windows & DOS: Issues & Discussions
Hi All,
This command works when I type it on but when I run the batch file it doesn't..any ideas why?
attrib.exe * | find /c /v "" >filecount.txt (1 Reply)
Discussion started by: Grueben
1 Replies
4. Shell Programming and Scripting
I have a command :
nawk 'BEGIN{print srand()}'
which gives the amount of seconds between January 1st 1970 00:00:00 (Unix Epoch) and the present time, to the closest second and I would want to append this time stamp every minute in a file which contains the data below which also has one row... (1 Reply)
Discussion started by: thinktank
1 Replies
5. UNIX for Advanced & Expert Users
OK , ..
This is an odd one. I have a new server and I need to have a tunnel open to it.
I have this exact process running on a few others but this new one I just got is not allowing the script to connect.
I set up my users account and ssh keys
from the server that will host the tunneling i... (6 Replies)
Discussion started by: jeffsandman0035
6 Replies
6. Shell Programming and Scripting
Hi All,
How do I provide the output of a command to another command which is waiting for an input from the user ?
Ex : I need to login to a device via telnet. In the script, initially I use the "read" command to get the IP Address, Username and Password of the device from the user. Now,... (1 Reply)
Discussion started by: sushant172
1 Replies
7. Shell Programming and Scripting
I have an xml file.
I am doing some change, say deleting line 770. File name is file.xml. I use:
sed '770d' file.xml
but this does not actually make changes in the *file* but shows the changes on standard output (screen)
if i use
$var=`sed '770d' file.xml`
echo $var > file.xml
this... (3 Replies)
Discussion started by: indianjassi
3 Replies
8. Shell Programming and Scripting
I'm new to PERL, but I want to take the page source and write it to a file or standard output. I used perl.org as a test website. Here is the script:
use strict;
use warnings;
use LWP::Simple;
getprint('http://www.perl.org') or die 'Unable to get page';
exit 0;
... (1 Reply)
Discussion started by: wxornot
1 Replies
9. Shell Programming and Scripting
hi
I'm trying to query a directory, check it's the right directory, return the results into a text file, put text file into an array and navigate the subdirectories and delete contents.
find `pwd` -type d | grep TESTINGDIR > dirList.txt
The txt file is created from the cmd-line but not in... (4 Replies)
Discussion started by: OFFSIHR
4 Replies
10. Shell Programming and Scripting
I am sending a kill comand to kill a process inside a SH script but I don`t want the user to notice it so I don´t want the message "1222 killed" to appear.
I`ve tried to redirect the standard output to /dev/null 2>&1 and also tried to use "nohup" but none of them was succesfull.
Can anyone... (1 Reply)
Discussion started by: pguinal
1 Replies