10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to do find and replace, but the pattern is not full known.
for example,
my file has /proj/app-d1/sun or /data/site-d1/conf
here app-d1 and site-d1 is not constant. It may be different in different files. common part is /proj/xx/sun and /data/xxx/conf
i want to find where ever... (6 Replies)
Discussion started by: rbalaj16
6 Replies
2. UNIX for Advanced & Expert Users
Currently I am using this laborious command
lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}'
Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies
3. Shell Programming and Scripting
Hi All,
Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created.
/Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt
/Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies
4. Shell Programming and Scripting
Im using the command below , but thats not the output that i want. it only prints the odd and even numbers.
awk '{if(NR%2){print $0 > "1"}else{print $0 > "2"}}'
Im hoping for something like this
file1:
Text hi this is just a test
text1 text2 text3 text4 text5 text6
Text hi... (2 Replies)
Discussion started by: invinzin21
2 Replies
5. Shell Programming and Scripting
Hi How Are you?
I am doing fine!
I need to go now?
I will see you tomorrow!
Basically I need to replace the entire line containing "doing" with a blank line:
I need to the following output:
Hi How Are you?
I need to go now?
I will see you tomorrow!
Thanks in advance.... (1 Reply)
Discussion started by: sags007_99
1 Replies
6. Shell Programming and Scripting
Input file
data20714 7327 7366 detail
data20714 7327 7366 main
data250821 56532 57634 detail
data250821 57527 57634 main
data250821 57359 57474 main
data250821 57212 57301 main
data250821 57140 57159 detail
data250821 56834 57082 main
data250821 56708 56779 main ... (3 Replies)
Discussion started by: perl_beginner
3 Replies
7. Shell Programming and Scripting
I have a pattern
username:x:32005:32006::/usr/local/user:/bin/bash
I need to match the line containing username and replace /bin/bash with /usr/local/my/bin/noshell
So it becomes
username:x:32005:32006::/usr/local/user:/usr/local/my/bin/noshell (7 Replies)
Discussion started by: anilcliff
7 Replies
8. Linux
Hi,
The below is the output of multipath -ll |grep -i ddn | awk '{print $1}' | tr -s '\n' ',':
/dev/mapper # multipath -ll |grep -i ddn | awk '{print $1}' | tr -s '\n' ','... (2 Replies)
Discussion started by: teav
2 Replies
9. Shell Programming and Scripting
Hi,
I am looking for any script which can do the following.
have to read a pattern from fileA and copy it to fileB.
fileA:
...
...
Header
...
...
..p1
...
...
fileB:
....
....
Header (3 Replies)
Discussion started by: anilvk
3 Replies
10. Shell Programming and Scripting
I need to replace the line containing "STAGE_DB" with the line
"STAGE_DB $DB # database that contains the table being loaded ($workingDB)"
Here $DB is passed during the runtime.
How can I do this?
Thanks,
Kousikan (2 Replies)
Discussion started by: kousikan
2 Replies