Bianca wrote:

> bash-3.00# awk -F"=" -v gr="888" '/RTSPPort/{$2=gr;}1' OFS="=" server.ini
> awk: syntax error near line 1
> awk: bailing out near line 1
> 
> Can you help me on why this doesn't work.

The Solaris /bin/awk is a very, very old implementation that doesn't
understand the '-v' option.  Use /usr/xpg4/bin/awk instead.  You could
try to use /bin/nawk ("new awk") but then you'd have to change the
'OFS="="' argument too.

BTW, are you sure you want to modify every line that contains the
string 'RTSPPort'?  Perhaps you want only the lines whose first field
is 'RTSPPort'.

> The next one neighter. Dosn't generate errors but doesn;t make the 
> replacement.
> Code:
> 
> sed -e "s-\(^DefaultStorageFolder=\)\([^#]*\)-\1$INSTALLDIR/cdr-" server.ini

The Solaris 'sed' treats the character '^' as meaning start-of-line
only when it occurs at the very beginning of a regular expression.
Change this command to:

   sed -e "s-^\(DefaultStorageFolder=\)\([^#]*\)-\1$INSTALLDIR/cdr-" server.ini

Mike.
-- 
mike.oliver at sun.com

Reply via email to