![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| String compare in shell script | kiranlalka | Shell Programming and Scripting | 2 | 11-29-2008 09:39 AM |
| compare two tables using shell script | dtidke | Shell Programming and Scripting | 1 | 06-25-2008 06:34 AM |
| perl script to list filenames that do not contain given string | royalibrahim | Shell Programming and Scripting | 21 | 04-22-2008 02:55 PM |
| How to compare the dates in shell script | vaji | Shell Programming and Scripting | 9 | 02-28-2007 12:34 AM |
| shell script cant recognize if else compare | jaseloh | Shell Programming and Scripting | 6 | 12-06-2005 11:34 PM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Hi , I am new to shell scripting. below is my requirement : 1) while running my .sh i will pass a string 2) i have to extract a folder name under a /config folder 3) i need to compare a input string in the folder name list 4) if that is true i have to continue my job else i have to give the message to the user here is my code : Code:
if [ $# -ne 1 ]; then
echo "Invalid arguments!"
echo ""
echo "job Name: $(basename $0) "
echo " Please pass the environment variable "
return 1
else
env_name="$1"
fi
LIST="`ls -ltr conf/ | grep -v "total" | grep -v "pre_swh" | awk '{ print $NF "," }'`";
if ["$env_name" in "$LIST"]
then
echo "correct"
else
echo "incorrect"
fi
counter1=`expr $counter1 + 1`
#done
while running this am gettin the error sample2.sh[25]: [test: not found. ![]() Please anyone help me on this Last edited by vidyadhar85; 06-11-2009 at 10:47 PM.. Reason: code tag added |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|