The UNIX and Linux Forums  


Go Back   The UNIX and Linux Forums > Top Forums > UNIX for Dummies Questions & Answers
.
google unix.com




View Single Post in the UNIX and Linux Forums - Click on the Thread or Permalink to View Entire Thread -->
  #2 (permalink)  
Old 08-06-2008
max29583 max29583 is offline
Registered User
  
 

Join Date: Dec 2006
Location: UK
Posts: 33
I tried like this after searching for it in the forums....

I=`grep 'I.P. Address' /install/cfgdist/`uname -n`.cfg | cut -d : -f 2 | cut -d . -f 1-3 | sed s/" "//g`

But its giving the error as:
abhits/39:[~] 183) ./abhi
./abhi: .cfg: not found
./abhi: -n: not found
Exit 1

If I run it on shell its working
abhits/39:[~] 185) grep 'I.P. Address' /install/cfgdist/`uname -n`.cfg
| cut -d : -f 2 | cut -d . -f 1-3 | sed s/" "//g
172.174.158

Please can someone help

Regards,
Abhi