10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
my inputfile:
This is a test and only a test for production - prod.
echo "This is a test and only a test for production - prod" | perl -pi -e 's/prod/test/g'
outputfile:
This is a test and only a test for testuction - test
I only want to replace prod, not production.
I also... (3 Replies)
Discussion started by: loktamann
3 Replies
2. Shell Programming and Scripting
Hi,
I have been trying to replace the key word
"SQL> spool off "
with
"/
show errors"
with out double quotes in all the files in a directory.
above show erros should be displayed next line
Could you please help me how to do that.
I have tried something like this... (3 Replies)
Discussion started by: pointers
3 Replies
3. Shell Programming and Scripting
Hi All,
If I have a line as following:
( MA "vertical" )
How can I convert it to as below:
( BC "horizontal" )
Thanks,
--Michael (6 Replies)
Discussion started by: mxn731
6 Replies
4. Shell Programming and Scripting
Hello,
I used the following script to conect to cisco router:
#!/usr/bin/perl
use strict;
use warnings;
use Getopt::Long;
use Opsware::NAS::Connect;
my($host, $port, $user, $pass) = ('localhost','$tc_proxy_telnet_port$','$tc_user_username$','$tc_user_password$');
my $device =... (5 Replies)
Discussion started by: ahmed_zaher
5 Replies
5. Shell Programming and Scripting
Hi,
I want to replace a word in a file which occurs after a particular word.
For example :
$cat file.txt
CASE
WHEN
AND c1 = 'I'
AND c2= '2'
THEN 1
WHEN
AND c1= 'I'
AND c2= '0'
THEN 2
So in this example i want to replace... (4 Replies)
Discussion started by: ashwin3086
4 Replies
6. Shell Programming and Scripting
Hi i am trying to write a perl program where i have to open a
1)directory "unit"
2) rename the files in the dir say file1.txt;file2.txt...file5.txt
to file1_a.txt;file2_a.txt,....file5_a.txt ;file1_x.txt ;file2_x.txt
3) open these renamed files and replace the words
lets say file1_a.txt... (7 Replies)
Discussion started by: madhul2002
7 Replies
7. UNIX for Dummies Questions & Answers
how to use sed command to find and replace a directory
i have a file.. which contains lot of paths ...
for eg.. file contains..
/usr/kk/rr/12345/1
/usr/kk/rr/12345/2
/usr/kk/rr/12345/3
/usr/kk/rr/12345/4
/usr/kk/rr/12345/5
/usr/kk/rr/12345/6
/usr/kk/rr/12345/7... (1 Reply)
Discussion started by: wip_vasikaran
1 Replies
8. UNIX for Dummies Questions & Answers
Guys,
I need to replace a portion of the lines in the file depending on the word
in my file i have this content
use DBNAME
go
print "use DBNAME"
i want to replace the variable DBNAME with something else. But the catch is this line is not always "use DBNAME". Sometimes it can be like "use... (3 Replies)
Discussion started by: sasiharitha
3 Replies
9. Shell Programming and Scripting
there are 300 files in a directory , some of these files has a word "error" , I word to change this word to "message" , can advise what can i do ? thx. (5 Replies)
Discussion started by: ust
5 Replies
10. Shell Programming and Scripting
I'm attempting to create a Perl script that will:
Take the contents of the usernames.tmp file
(usernames.tmp is created from an awk one-liner ran against /etc/passwd)
Take one line at a time and pass it to the su command as a users name.
This should go on until there is no more name to... (10 Replies)
Discussion started by: bru
10 Replies