- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: simple test in a 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
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
03-09-2005 02:06 AM
03-09-2005 02:06 AM
until cmp -s $SOURCE /var/STOCK_ARCHIVE/$SOURCE
do
cp -p $SOURCE /var/STOCK_ARCHIVE/
sleep 300
done
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:09 AM
03-09-2005 02:09 AM
Re: simple test in a script
if [ -s /dir/filename ] ; then
do something
else
doe something else
fi
'man test' for more information and other options.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:10 AM
03-09-2005 02:10 AM
Re: simple test in a script
if [ -s /var/STOCK_ARCHIVE/${SOURCE} ]
then
file is not empty
else
file is empty
fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:18 AM
03-09-2005 02:18 AM
Re: simple test in a script
I need to loop it back.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:21 AM
03-09-2005 02:21 AM
Re: simple test in a script
The test condition or [condition] - (K) = Korn shell specific
Testing Files
-a file file exists (K)
-b file file exists and is a block special file.
-c file file exists and is a character special file
-d file file exists and is a directory
-e file true if the file exists
-f file file exists and is a regular file
-G file file exists and its group is the effective group ID. (K)
-g file file exists and its set-group-id bit is set
-k file file exists and its sticky bit is set.
-L file file exists and is a symbolic link (K)
-O file file exists and its owner is the effective user ID (K)
-o c Option c is on (K)
-p file file exists and is a named pipe (fifo)
-r file file exists and is readable
-S file file exists and is a socket (K)
-s file file exists and has a size grreater than zero
-t [n] The open file descriptor n is associated with a terminal device; default n is 1
-u file file exists and its set-user-id bit is set
-w file file exists and is writable
-x file file exists and is executable
f1 -ef f2 files f1 and f2 are linked (refer to same file) (K)
f1 -nt f2 file f1 is newer than f2 (K)
f1 -ot f2 file f1 is older than f2 (K)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:30 AM
03-09-2005 02:30 AM
Solutionwww.shelldorado.com will help
Also put a while loop round your loop
while [ ! -s "/tmp/toto" ]
do
ll -d /tmp/toto
echo lala
sleep 30
done
As long as /tmp/toto is zero length loop continues
Steve Steel
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
03-09-2005 02:44 AM
03-09-2005 02:44 AM
Re: simple test in a script
B