Unix/Linux Forum: editing files using bash scripts - Unix/Linux Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

editing files using bash scripts Rate Topic: -----

#1 User is offline   Asteroid 

  • User Level: 1/10
  • Pip
  • Group: Members
  • Posts: 11
  • Joined: 03-August 07

Posted 22 January 2009 - 06:27 AM

hi guys,

We have to implement new local (/etc/default/login) USER security policy on almost 50 stations.
so editing /etc/default/login and /etc/default/passwd will be way too long work.
Can we do the same using some script, I mean editing the above files and putting variables as RETRIES=3, DISABLETIME=60, TIMEOUT=30 etc etc.

Thank you for the assistance.

@Asteroid.
0

#2 User is offline   vibhor_agarwalin 

  • User Level: 7/10
  • PipPipPipPipPipPipPip
  • Group: Members
  • Posts: 574
  • Joined: 24-June 05

Posted 22 January 2009 - 12:23 PM

For eg.

You want to replace A with B

sed 's/A/B/g' file > tmp_file

Check your tmp_file

mv tmp_file file
Vibhor Kumar Agarwal
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users