![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| what is output of this scrypt | kaydream | UNIX for Dummies Questions & Answers | 1 | 4 Weeks Ago 01:30 PM |
| "SCRYPT" command in RED HAT 9 | nsharath | Red Hat | 2 | 01-06-2009 11:50 AM |
| Awk: Can anyone tell me why this doesn't work? | ksheller | Shell Programming and Scripting | 8 | 11-10-2008 05:45 PM |
| Script doesn't work, but commands inside work | cheongww | UNIX for Dummies Questions & Answers | 2 | 11-14-2006 10:52 PM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
how this scrypt work
hi i want to know what is the output of this lines Code:
LineNr=`fgrep -n $Search $File |cut -d: -f1` # Zeilennummer ntp
Cmd="$LineNr s/^# //\nw\nq" # ed-Kommando
echo "$Cmd" | ed -s $File >/dev/null # ed-Aufruf
in below scrypt Code:
File=/etc/inittab # Datei zum Bearbeiten
Search=Ntp.Cntl # String zum Suchen
if [ -n "`fgrep $Search $File`" ]
then
LineNr=`fgrep -n $Search $File |cut -d: -f1` # Zeilennummer ntp
Cmd="$LineNr s/^# //\nw\nq" # ed-Kommando
echo "$Cmd" | ed -s $File >/dev/null # ed-Aufruf
else
LineNr=`fgrep -n InfPmBoot $File | cut -d: -f1` # Zeilennummer
PmBoot
Line="pm:2:once:/sys/inf/InfPmCall /sys/inf/Ntp.Cntl stop"
Line="$Line >/dev/null 2>&1" # Zeile zum Einfuegen
Cmd="$LineNr a\n$Line\n.\nw\nq" # ed-Kommando
echo "$Cmd" | ed -s $File # ed-Aufruf
fi
Last edited by kaydream; 4 Weeks Ago at 12:59 AM.. |
![]() |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|