CGI/Perl Guide | Learning Center | Forums | Advertise | Login
Site Search: in

  Main Index MAIN
INDEX
Search Posts SEARCH
POSTS
Who's Online WHO'S
ONLINE
Log in LOG
IN

Home: Perl Programming Help: Intermediate:
problem help needed - -please advise

 



t_shtilman
New User

Mar 30, 2009, 6:30 AM

Post #1 of 1 (297 views)
problem help needed - -please advise Can't Post

Hi Guys
I am new to perl , trying to fix a script line

perl -pi -e "s/^(MachineName=).*/\$1`hostname`/;" /env_file

this should replace the MachineName= with MachineName=<the real host name> in the env_file

if hostname start with numbers , like '97979-myhost.com' the number and MachineName is being removed also from file

when hostname return something which has no numeric chars like 'myhost1.com' replacement work smoothly

Any help will be much appreciated
Thanks
TS

 
 


Search for (options) Powered by Gossamer Forum v.1.2.0

Web Applications & Managed Hosting Powered by Gossamer Threads
Visit our Mailing List Archives