Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

modify a profile

Status
Not open for further replies.

vti

Technical User
Feb 26, 2001
189
TR
Hi all
I am trying to put some lines into users profiles .For example ;

aaaaaaaa#
bbbbbbbb#
trap "" 2 3 5 15
cccccccc#
dddddddd#

and i want to put a path of scipt line between bbbbbbbb# and "trap line" like ;

aaaaaaaa#
bbbbbbbb#
./usr/users/user1/script
trap "" 2 3 5 15
cccccccc#
dddddddd#

Profiles are not same for all users.But i can put script path under the trap line for all users.Is it possible?
 
Is this what you want?
Code:
{
  if ($1 == "trap") {
    print "./usr/users/user1/script"
  }
  print
}
Hope this helps. CaKiwi
 
hi
thanks for help
i have tried but it gives me the this error

# ./tobetween.scr .profile
./tobetween.scr: syntax error at line 3 : `{' unexpected

Maybe i have applied wrong .Would you please tell me the right way.

Regards.
 
You need to run it using awk as follows.
Code:
awk -f tobetween.scr .profile
CaKiwi
 
it works well but it's only print out on the screen ,when i edit the file again it is still wrong.How can i save the file.?

Thanks a lot
 
Use
Code:
awk -f tobetween.scr .profile > tmp.profile
mv tmp.profile .profile
CaKiwi
 
Thank you so much,it works well.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top