User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Shell Scripting section within the Software Development category of DaniWeb, a massive community of 456,442 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 2,626 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Shell Scripting advertiser: Programming Forums
Views: 1347 | Replies: 0
Reply
Join Date: Aug 2007
Posts: 27
Reputation: skelly16 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 0
skelly16 skelly16 is offline Offline
Light Poster

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

  #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.
AddThis Social Bookmark Button
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Shell Scripting Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Shell Scripting Forum

All times are GMT -4. The time now is 1:45 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC