biff n
pdir=`pwd`
# check for null parameter
if [ $# -lt 1 ]; then
echo current directory $pdir
ls -latr
echo
else
p1=$1
#check for directory entry only
if [ -d $p1 ]; then
pdir=$p1
echo current directory $pdir
cd $pdir
ls -latr
echo
#check for directory entry and file
elif [ -f $p1 ]; then
pdir=`dirname $p1`
echo current directory $pdir
cd $pdir
for f in $*
do
pfile=`basename $f`
ls -altr $pfile
done
else
echo $p1 not found
fi
fi
# put a white space
echo
i have the above piece of code that accepts a parameter input to display directory file listing. the script runs fine on the unix command line with an example output of:
$ sh dir_file_list.sh /u02/app/pcrd/dev/out
current directory /u02/app/pcrd/dev/out
total 24
drwxr-xr-x 3 oracle oracle 256 Jun 29 14:10 ..
-rw-r--r-- 1 oracle oracle 5597 Jul 04 18:00 PCARD_EXPORT_7.csv
drwxr-xr-x 2 oracle oracle 256 Jul 06 18:00 .
-rw-r--r-- 1 oracle oracle 311 Jul 06 18:00 PCARD_EXPORT_8.csv
i created the script to run from a scheduler called TIDAL. basically the scheduler is tool that runs on a windows platform and has agents on each servers that operates and runs any programs. when the script runs from a scheduler it gets a message on the first line as "Where are you?":
Where are you?
current directory /u02/app/pcrd/dev/out
total 24
drwxr-xr-x 3 oracle oracle 256 Jun 29 14:10 ..
-rw-r--r-- 1 oracle oracle 5597 Jul 04 18:00 PCARD_EXPORT_7.csv
drwxr-xr-x 2 oracle oracle 256 Jul 06 18:00 .
-rw-r--r-- 1 oracle oracle 311 Jul 06 18:00 PCARD_EXPORT_8.csv
how do i suppress that "Where are you?" message? thanks.