A
ahq_2001
Hi, Guys:
I think perl should have the same ability to do this, but just not sure
how. Any help is welcomed!!!
Directory A (/home/dir_a) have these files:
file_A, file_B, file_C.
Directory B (/home/dir_b) have the corresponding notes:
file_A_note, file_B_note, file_C_note.
To append file_X_note into file_X at the end of the line
"Put_Note_Here" in file_A:
I know foreach + sed can do this with:
In dir_A: use
foreach f (*)
Can any one help to show how can I use perl one-liner ( and/or shell
"foreach" ) to achieve the same function? (No offend to sed lover, but
I just prefer using perl... )
Many thanks.
AhQ
I think perl should have the same ability to do this, but just not sure
how. Any help is welcomed!!!
Directory A (/home/dir_a) have these files:
file_A, file_B, file_C.
Directory B (/home/dir_b) have the corresponding notes:
file_A_note, file_B_note, file_C_note.
To append file_X_note into file_X at the end of the line
"Put_Note_Here" in file_A:
I know foreach + sed can do this with:
In dir_A: use
foreach f (*)
sed "/Put_Note_Here/ r ../dir_b/$f.note" $f >! tmp1 && mv tmp1 $f
end
Can any one help to show how can I use perl one-liner ( and/or shell
"foreach" ) to achieve the same function? (No offend to sed lover, but
I just prefer using perl... )
Many thanks.
AhQ