The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
script or piece of code where the data returned by a stored procedure you are writing enigma_83 Shell Programming and Scripting 3 04-25-2008 03:44 AM
Where can I review the source code? Aaron Van UNIX for Dummies Questions & Answers 1 09-07-2007 11:58 PM
Can someone review my code tell me where I am going wrong? chrchcol Shell Programming and Scripting 4 07-28-2006 03:54 PM
what does this piece of code do? Vikas Sood Shell Programming and Scripting 3 06-05-2006 01:28 PM
Can some review my code would be appreicated? sibghat Shell Programming and Scripting 1 09-29-2005 12:51 PM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 07-19-2005
Registered User
 

Join Date: Jul 2005
Posts: 10
a piece of code, plz help to review

use "getopts" to get params from command. Need replace black with a specified string like "%20

DEFAULT_DELIM=%20
...
while getopts dek:f:t:vh OPTION
do
case $OPTION in
t)
DELIM=`tvar=/'"$OPTARG"'/ svar="$DEFAULT_DELIM" awk 'BEGIN{T=ENVIRON["tvar"];S=ENVIRON["svar"]; while(index(T,S)!=0){S=S"0"};print $S;exit}'`
for var in $OPTARG
do
if [ "$TMP" = "" ]
then
TMP=$var
else
TMP=$TMP$DELIM$var
fi
done
;;
...

Why DELIM is always null

Thanks.
Reply With Quote
Google The UNIX and Linux Forums
Forum Sponsor
Reply

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 05:05 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0