Help with shell script which looks for a set off files within a directory

Please support our Shell Scripting advertiser: Programming Forums - DaniWeb Sister Site
Reply

Join Date: Aug 2007
Posts: 34
Reputation: skelly16 is an unknown quantity at this point 
Solved Threads: 0
skelly16 skelly16 is offline Offline
Light Poster

Help with shell script which looks for a set off files within a directory

 
0
  #1
Aug 30th, 2007
Hi Script Masters

Im new to scripting and having trouble to get this script to work. Basically i want my script to look for files within this directory

/apps/gnp/prd/asia/geacssm/ssr/GNPP02/var/ft/backup/

I have put all the files i want to look for in the above directory in a txt file, example of what the files look like:

ledg_ofssgi_02

they normally have a date stamp beside like this ledg_ofssgi_02.3008

This means the file for the 30th August, but because i want to run this script daily , i need to use the date command.

To look for the files i would normally take a file at a time and go into the directory and do ls-ltr *ledg_ofssgi_02.3008* to see if its there

Im trying to use variables, but i just cant get my head round it (
#!/bin/ksh

set - x

PATH="/apps/gnp/prd/asia/geacssm/ssr/GNPP02/var/ft/backup/"
DST='date +%d%m*'
LIST='ls -ltr'
FEEDS=/export/home/u820052/files.txt

cat $FEEDS | while read listval
do
fed=`echo $listval`
dpath=`cd ${PATH}/${LIST}

I just cant get pass the 1st line cat $FEEDS wont work saying cat is not found.


I can get some of it working doing this instead

cd /apps/gnp/prd/asia/geacssm/ssr/GNPP02/var/ft/backup/

ls -ltr > /export/home/u820052/feed.txt

cat $FEED | nawk ' { print $6,$7,$8,$9 }' |

But then i need to see if my files with todays date is in the directory. i need to add it in somewhere

Im a confuzed and fedup script begineer needing some help and explanation on what im doing wrong.
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:


Thread Tools Search this Thread



Tag cloud for Shell Scripting
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC