10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Need to replace last field in a file(/etc/passwd) ,if first filed matches with particular username.
Scenario:
cat testfor1
deekshi:x:7082:7082::/home/deekshi:/bin/bash
harini1:x:7083:7083::/home/harini1:/bin/bash
Here,if first field contains "deekshi", then i should replace... (4 Replies)
Discussion started by: Sumanthsv
4 Replies
2. Shell Programming and Scripting
I have very large perl source code file and I want to replace every occurrence function say foo,The function foo has some arguments and I want to replace 2nd argument,the current argument is hex integer and i want to replace it to equivalent string.Also I want to replace function name foo with... (4 Replies)
Discussion started by: pravint
4 Replies
3. Shell Programming and Scripting
Hi all,
I have a requirement to replace a field with a character as per the length of the field.
Suppose i have a file where second field is of 20 character length. I want to replace second field with 20 stars (*). like ********************
As the field is not a fixed one, i want to do the... (2 Replies)
Discussion started by: gani_85
2 Replies
4. Shell Programming and Scripting
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (2 Replies)
Discussion started by: i.srini89
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
How to replace only the function calls with a new name and skip the function definition and declarations. consider the following code.
There are 2 functions defined here returnint and returnvoid.
I need to replace returnint with giveint and returnvoid with givevoid only in the function... (1 Reply)
Discussion started by: i.srini89
1 Replies
6. Shell Programming and Scripting
i have something like this,
cat filename.txt
hui this si s"dfgdfg" omeone ipaddress="10.19.123.104" wel hope this works
i want to replace only 10.19.123.104 with different ip say 10.19.123.103
i tried this
sed -i "s/'ipaddress'/'ipaddress=10.19.123.103'/g" filename.txt
... (1 Reply)
Discussion started by: vivek d r
1 Replies
7. Shell Programming and Scripting
I have got about 100 ascii files and I want replace some variable with a new one on an HP-UX system. But I want to put a line of comments before the change. I want to make file1 to file2. I am explaining below.
file1:
line1
line2
export QNAME=ABC
line4
line5
file2:
line1
line2
#... (3 Replies)
Discussion started by: asutoshch
3 Replies
8. Shell Programming and Scripting
Something like vlookup in excel, column 2 in file 2 is blank and should be replaced by column 2 in file 1 based on comparing column 1 in both files.
file1
Code:
1234~abc~b~c~d~e~f~g~h~09/10/09
5678~def~b~c~d~e~f~g~h~12/06/10
8910~hij~b~c~d~e~f~g~h~03/28/13... (1 Reply)
Discussion started by: sigh2010
1 Replies
9. Shell Programming and Scripting
consider this is a line A#B#C#D#E#F#G#H
note the delimeter is #
i want to cut or spilt in to fields using the delimeter # and to store in an array.
like this
array=A
array=B
array=C
array=D
array=E
and the array content should be displayed.
echo "${array}"
echo "${array}"... (5 Replies)
Discussion started by: barani75
5 Replies
10. Shell Programming and Scripting
I have a line like this:
I want to move HTTP/1.1 200 OK to the next line and put a blank line between the two lines i.e.
How can i get it using awk?
Thanks in advance (2 Replies)
Discussion started by: littleboyblu
2 Replies