I am on a windows 2003 server, trying to write a dos batch script.
I have a file with a date in it "date.txt"
content looks like "Thu Mar 29 12:27:36 2012"
I have another file copy.cmd that has 5 input parms corresponding to the 5 date parts above %1 is for "day", %2 is for "month", %3 is for...
Issue solved. my command now works in the script.
CSTIME=$(grep "$JNAME" "$TBL" | cut -f2 -d',')
My issue was unseen characters caused by the windows editor.
I removed them by using "dos2unix temp1.ksh temp2.ksh"
Thanks to everyone that replied.
I am using ksh on a SunOS machine. I cannot figure out why I am receiving this "if" error.
SYTIME="10:30"
if [ -n "$QETIME" ]; then
JEND=$SYTIME
fi
echo QETIME:$QETIME
echo JEND:$JEND
all good replies. I seem to have isolated the issue down to just the grep part.
original command:
JNAME=PA3.1
TBL=Jobcheck.tbl
CSTIME=$(grep $JNAME $TBL | cut -f2 -d',')
simple command:
Jobcheck.tbl contains "PA3.1,0,0,0,20"
echo $JNAME
CSTIME=$(grep $JNAME Jobcheck.tbl)
I echo $JNAME before...
Been away from this for awhile. My last work with unix shell was on HPUX about 8 years ago. How can I tell what shell version? OS is Solaris 10 10/09 s10s_u8wos_08a SPARC
this command works
CSTIME=$(grep "PA3.1" Jobcheck.tbl | cut -f2 -d',')
but when I replace the values with variables with same values
CSTIME=$(grep $JNAME $TBL | cut -f2 -d',')
I get "error can't open Jobcheck.tbl"
Am I missing special characters in the 2nd grep command?
Any help would be...
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.