Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations bkrike on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Recent content by tekinfarmland

  1. tekinfarmland

    DOS Batch-How CMD file use input from another files content

    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...
  2. tekinfarmland

    grep variable replacement error - can't open file

    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.
  3. tekinfarmland

    syntax error at line 2 : `if' unmatched

    Sweet! That was the ticket to my troubles.
  4. tekinfarmland

    syntax error at line 2 : `if' unmatched

    The entire script is posted at the top of the thread. I was answering a specific correction suggested by "ProbablyDown:
  5. tekinfarmland

    syntax error at line 2 : `if' unmatched

    did you mean changing it like this? if [[ -n "$QETIME" ]]; then because that did not work either. same error.
  6. tekinfarmland

    syntax error at line 2 : `if' unmatched

    syntax error at line 2 : `if' unmatched
  7. tekinfarmland

    syntax error at line 2 : `if' unmatched

    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
  8. tekinfarmland

    grep variable replacement error - can't open file

    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...
  9. tekinfarmland

    grep variable replacement error - can't open file

    exactly that is the odd problem. Jobcheck.tbl IS in the same directory as the the file executing (Jobcheck.ksh). and both files are set to 7777.
  10. tekinfarmland

    grep variable replacement error - can't open file

    no, the awk version did not work. "awk: can't open ./Jobcheck.tbl"
  11. tekinfarmland

    grep variable replacement error - can't open file

    looks like it is ksh $ ps -fp $$ UID PID PPID C STIME TTY TIME CMD leroy 3625 3633 0 06:34:49 pts/1 0:00 -ksh
  12. tekinfarmland

    grep variable replacement error - can't open file

    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
  13. tekinfarmland

    grep variable replacement error - can't open file

    Thanks, I tried the () idea and it did not work.
  14. tekinfarmland

    grep variable replacement error - can't open file

    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...

Part and Inventory Search

Back
Top