![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Advanced & Expert Users Advanced UNIX and Linux questions go here. Expert-to-Expert. |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| Help Required: Command to find IP address and command executed of a user | loggedout | Security | 2 | 08-06-2008 05:12 PM |
| how to? launch command with string of command line options | TinCanFury | Shell Programming and Scripting | 5 | 04-28-2008 03:06 PM |
| inconsistent ls command display at the command prompt & running as a cron job | rajranibl | Linux | 5 | 07-30-2007 05:26 AM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | HP-UX | 1 | 10-16-2006 01:16 PM |
| How to use more than one MPE command STREAM with Unix command in a single shell? | bosskr | Shell Programming and Scripting | 0 | 09-19-2006 06:44 PM |
|
|
Submit Tools | LinkBack | Thread Tools | Search this Thread | Display Modes |
|
#1
|
|||
|
|||
|
Or command
I am having trouble with an Or command in my UNIX script.
It is as follows: Quote:
The holdfile is correct and putting out the right result and the dan.txt is also right stripping the first 4 characters off each file name. Any ideas? |
| Forum Sponsor | ||
|
|
|
#2
|
||||
|
||||
|
I would use "case" instead:
Code:
for i in `cat ${OUT_DIR}/holdfile`
do
#Check each file has the correct name begins with PACK or LETT
LETTYPE=`expr substr $i 1 4`
echo "$LETTYPE" >> dan.txt
case $LETTYPE in
LETT|PACK)
# Do nothing.
:;;
*)
# Exit.
echo "Invalid file name, look at holdfile ($i)"
exit 1
;;
esac
done
echo "Valid file names for processing" >> ${LOGFILE}
|
|
#3
|
|||
|
|||
|
Thanks for that I've got it working
|
|||
| Google The UNIX and Linux Forums |