The UNIX and Linux Forums  

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



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

Reply
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 4 Weeks Ago
kaydream kaydream is offline
Registered User
  
 

Join Date: Jul 2009
Posts: 10
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..
Reply

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 04:42 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0