10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Iam a newbie to SED. I'm faced with a problem as described.
Given the file with text
1 rwerwerwe rere
2 fdfefefe fsdfds
3 rerere ffff trtrt
4 aaaa 1234 asadsdsd
5 hfjfjfjsjfsf... (14 Replies)
Discussion started by: SShinde
14 Replies
2. Shell Programming and Scripting
Hi,
I have a file a.xml containing the below
<customerId>000</customerId>
and a variable CUSTOMER_ID which is set to '333'
Now I want to replace <customerId>000</customerId> with <customerId>333</customerId> by the below sed command and save the output in a file b.xml:
sed... (3 Replies)
Discussion started by: RomitaaChawla@1
3 Replies
3. Shell Programming and Scripting
Hello,
I have a file that I want to be able to insert a new line before every instance of a regex. I can get it to do this for each line that contains the regex, but not for each instance.
Contents of infile:
Test this 1...
Test this 2...
Test this 3... Test this 4... Test this... (2 Replies)
Discussion started by: deneuve01
2 Replies
4. UNIX for Dummies Questions & Answers
Hi All,
I need to frame a unix script to logon to a unix box. The credentials needs to be obtained from a property file on the same location.
I am trying to use 'expect' and 'spawn' command to meet this req.
When I am passing values, these commands are working fine. but when I am trying to... (3 Replies)
Discussion started by: mailkarthik
3 Replies
5. Shell Programming and Scripting
hi All,
i want to add the single digit front of the line in the report file and string compare with pattern file.
patter file: pattern1.txt
pattern num
like 4
love 3
john 2
report file: report.txt
i like very much
but john is good boy
i will love u
so after execute... (9 Replies)
Discussion started by: krbala1985
9 Replies
6. Shell Programming and Scripting
Hi all,
I want write a script to display 5rows at times from a input file.
my out like:
echo " display started"
r1
r2
r3
r4
r5
... Some action items...
again i need next 5 lines.
can you please advise. (2 Replies)
Discussion started by: koti_rama
2 Replies
7. Shell Programming and Scripting
Hello all,
I am very new to the shell scripting and I hope someone can help me with this.
I have thousands of files with certain format of information and I need to do this for all my files.
For each file, grab the numbers in the first and second rows and place them in the position 1 and 2... (8 Replies)
Discussion started by: GoldenFire
8 Replies
8. Shell Programming and Scripting
Hi All,
I am trying to use a sed command in a shell script in order to delete some lines in a file and I got the following error message.
I don't understand why it is not working 'cause I have tried with simple quotes, then with double-quotes, and it is not working.
sed: -e expression #1,... (7 Replies)
Discussion started by: Alpha3363
7 Replies
9. UNIX for Dummies Questions & Answers
I am trying to write a simple script which will take a variable with sed to take a line out of a text and display it
#!/bin/sh
exec 3<list
while read list<&3
do
echo $list
sed -n '$list p'<list2
done
this does not work, yet when I replace the $list variable from the sed command and... (1 Reply)
Discussion started by: MaestroRage
1 Replies
10. Shell Programming and Scripting
I need to assign a variable within a variable in a sed command.
I tried doing the following in c shell.
set left = 1
set right = 2
set segment = qwerty
sed -n -e "/$segment{$left}/,/$segment{$right}/p" file.txt
what is wrong with this syntax? (3 Replies)
Discussion started by: wxornot
3 Replies