10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I am trying to do some substitutions using the substitution operator (:%s) in a text file.
I want to replace all A1, A2, A3.......A100 in my text file.
I used :%s/A2/SAE/g successfully until A9 but when I use A1, all the A11 to A19 is changed. How do I specify the exact match here? (8 Replies)
Discussion started by: Kanja
8 Replies
2. Shell Programming and Scripting
Hi,
I'm trying to reformat some badly formatted XML that I've extracted from Oracle clob columns using the following nawk command:
nawk '{gsub(/</,/>\n/); print}' test.raw > test.xml
the substitution executes fine, but instead of subbing < with > followed by newline, it subs the < with a... (3 Replies)
Discussion started by: sffuji
3 Replies
3. Shell Programming and Scripting
Hi All,
I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command.
The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies
4. Shell Programming and Scripting
Hi all
Having issue with substitution using sed
Trying to assign the absolute path of the file to the variable 'floc' returned by the find command
floc=`find / -name $fname`
eg cat $floc '/root/samplecheck/myfile'
I want to replace '/' with '->' in the 'floc' i am using the below sed... (2 Replies)
Discussion started by: amithsebkanattt
2 Replies
5. Shell Programming and Scripting
Hello everyone ...
I'm going crazy, I hope some of you can help me ...
I have to replace a line in a crontab like this:
5 2 * * 2 root backupdat
with this:
5 5 * * 3 root backupdat
the command I use is the following:
sed -i.bak -e 's/5 2 * * 2 root backupdat/5 5 * * 3 root... (4 Replies)
Discussion started by: ionral
4 Replies
6. Shell Programming and Scripting
Hello, I'm trying to do a substitution in vi. which adds a field for the year to a line.
If the line doesnt include a year, it should still add a field (although empty)
the fields are:
Country:number:number:name(and sometimes year):place
this is a desired in and output:
Sweden:55:32:John... (2 Replies)
Discussion started by: drareeg
2 Replies
7. Shell Programming and Scripting
1) ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547425069636596::6:N:mrs charles:N:PH:00010031:0001'
OUTPUT - ABC::2197.12:2197.12:120217144365::+DEF:INT:1:N::::6:550.00:0.00:2009-04-29:CN:4547******636596::6:N:mrs charles:N:PH:00010031:0001'
The... (5 Replies)
Discussion started by: mad_man12
5 Replies
8. Shell Programming and Scripting
All,
I have this text document that contains a listing(See below).
What i would like to ask is how i could extract just the information i need which is the files name (CWS*****.***.gz)
If anyone has any suggestions i would be very grateful. I am sure its relatively simple but i just... (6 Replies)
Discussion started by: Andyp2704
6 Replies
9. Shell Programming and Scripting
Hi,
What is the actual difference between these two? Why the following code works for process substitution and fails for command substitution?
while IFS= read -r line; do echo $line; done < <(cat file)executes successfully and display the contents of the file
But,
while IFS='\n' read -r... (3 Replies)
Discussion started by: royalibrahim
3 Replies
10. Solaris
#!/bin/ksh
VAR_ONE=HELLO
TEMP=ONE
echo $VAR_${TEMP}
## Output is: ONE
Hi, I want the output to echo HELLO and not ONE as the above script does. I know I am missing something with dollar substitution. Can anyone help me out ?
Thanks.
Cal (4 Replies)
Discussion started by: calredd
4 Replies