- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Help with script
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Forums
Discussions
Discussions
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2000 07:33 AM
07-19-2000 07:33 AM
Help with script
Thanks,
Junior
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2000 07:36 AM
07-19-2000 07:36 AM
Re: Help with script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2000 08:05 AM
07-19-2000 08:05 AM
Re: Help with script
could it be that whithin your subirs there are files that begin with -* ?
Check this with a find command.
If so change your ll command to:
ll ./$FILE
This will prevent interpreting the filename as an option for ll.
Regards
Andrew
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2000 09:17 AM
07-19-2000 09:17 AM
Re: Help with script
ll -d $RETAILRE/*/* $RETAILRE/*/data.*/* | grep -v "^d" >> $LOGFILE
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-19-2000 01:10 PM
07-19-2000 01:10 PM
Re: Help with script
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-20-2000 06:58 AM
07-20-2000 06:58 AM
Re: Help with script
The following logic (utilizing your structure, excerpted from your script - it will have to be inserted, replacing the old logic, to work properly) will do what I think you want:
cd $RETAILRE
for DIR in `ll | grep ^d | awk '{print $9}'`
do
echo $DIR >> $LOGFILE
cd $DIR
for FILE in `ls $DATA`
do
if [[ -f $FILE ]]
then
ll $FILE >> $LOGFILE
fi
done
cd $RETAILRE
done
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-27-2000 11:32 AM
07-27-2000 11:32 AM
Re: Help with script
for file in *
will work fine when there are files to match, however when there are none it will return "*" as file once.
This could have been explicitly tested in the original coding loop as an exception case.
Alternatively Alan and Douglas's suggestions are (better) alternatives.
for file in $DATA/*; do
if [ "$file" = "$DATA/*" ]; then
break
fi
...
done
Note that the shell expands $DATA, but not * within the quotes!