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 IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

sh: A300: not found

Status
Not open for further replies.

jmanj

Programmer
May 20, 2003
298
US
The ksh scripts runs okay but getting this message everytime:

sh: A300: not found

Any help is appreciated.
 
And what does the script look like? Right now, I can only guess that somewhere there's a line like this:

[tt]$COMD $PARAM[/tt]

and COMD is an unknown shell variable; the variable PARAM is set to "A300", which builds the command line

[tt] A300[/tt]

which the shell complains about. It treats A300 as a command which it can't find.

HTH,

p5wizard
 
Here's my script. APSSDIR and ARCHIVE are environmental variables:

#!/bin/ksh
umask 0

PL=$ENVNAME

WORKDIR1=${APPSDIR}/${PL}/interface/OUT
WORKDIR2=${APPSDIR}/${PL}/interface
Y6FILE="Y6FILE.txt"
PATTERN="Y6906"

cd ${WORKDIR1}

find . -type f -name "$PATTERN*" -print | cut -c 3-500 | grep -v '/' > ${WORKDIR2}/${Y6FILE}


cat "${WORKDIR2}/${Y6FILE}" | while read WORKFILES

do

# to archive

cp $WORKDIR1/$WORKFILES $ARCHIVE/interfaces/OUT-Archive/`date +%y%m%d%H%M%S`$WORKFILES

# Now delete files older than 100 days

find $ARCHIVE/interfaces/OUT-Archive -name "*$WORKFILES" -mtime +100 -exec rm -f {} \;

# cOPY FILES TO THE ORIGINAL DIRECTORY


cp $WORKDIR1/$WORKFILES $WORKDIR2


done

rm ${WORKDIR2}/${Y6FILE}

cd ${WORKDIR1}

rm Y6906*

Thanks for any help on this.
 
I can't see anything obviously wrong looking at the script.

Try adding a set -x near the top of the script, log all of the script output (including standard error output) by using something like /path/to/script.sh > /tmp/script.out 2>&1, and then examine the log file to see where the A300 appears.

Annihilannic.
 
Or you have somewhere in your filetree a symbolic link named A300 that leads to a path that doesn't exist (anymore)...

use this command

[tt]find . -type l -name A300[/tt]

and then see where it (doesn't ;-)) point to.

HTH,

p5wizard
 
Thanks for all your suggestion. It helps a lot. I will try your suggestions but this may take some time. We are starting to upgrade our application and environment so I may take awhile to post my findings.

Thanks all.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top