R
roller
Perl Gurus I need some help,
I am currently using a shell script to read in a file of usernames and
then for each matching one in a seperate file change the matching
line. The problem is I do this by grep -v username file1 > file1.temp
and then move file1.temp over file1. What this does is it sticks all
the changes at the bottom. I need to preserve the structure in file1
which is like this:
# Comment
username -soft server:/export/vol00/users:username
Because the comment explains some details of the user below. How can I
use perl to read in a file of usernames then for each match in file1
do an in line edit using
s/server/another_server/
This way I can ensure the comment above each matching line still
explains the line below.
Thanks
I am currently using a shell script to read in a file of usernames and
then for each matching one in a seperate file change the matching
line. The problem is I do this by grep -v username file1 > file1.temp
and then move file1.temp over file1. What this does is it sticks all
the changes at the bottom. I need to preserve the structure in file1
which is like this:
# Comment
username -soft server:/export/vol00/users:username
Because the comment explains some details of the user below. How can I
use perl to read in a file of usernames then for each match in file1
do an in line edit using
s/server/another_server/
This way I can ensure the comment above each matching line still
explains the line below.
Thanks