- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: shell script question ..... regarding file siz...
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
Discussions
Discussions
Forums
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
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
тАО08-11-2004 05:43 AM
тАО08-11-2004 05:43 AM
If it is greater than zero bytes .... I want to send and email to abc ..... if it is zero bytes I want to email def.
Here is the test I am doing and I am getting a "if: Badly formed number." error and the script halts.
Can anyone tell me where I am going wrong?
if (-s /directsm/errors.txt) then
elm -s EDI_ERROR abc@abc.com < /directsm/errors.txt
else
elm -s $SHIPPERFILE def@abc.com < $TDFFILE
endif
Solved! Go to Solution.
- Tags:
- csh
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 05:48 AM
тАО08-11-2004 05:48 AM
Re: shell script question ..... regarding file size test
if [ -s /directsm/errors.txt ]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 05:49 AM
тАО08-11-2004 05:49 AM
Re: shell script question ..... regarding file size test
Try:
if [ -s /directsm/errors.txt ]
then
...
fi
Regards,
Dave
[Any personal opinions expressed are mine, and not official statements on behalf of Hewlett Packard Enterprise]
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 06:16 AM
тАО08-11-2004 06:16 AM
SolutionThe "-s" is not a valid csh selection. You could use "-z" to test for zero instead.
if ( -z /directsm/errors.txt ) then
elm ...
else
elm ...
endif
HTH
-- Rod Hills
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 07:18 AM
тАО08-11-2004 07:18 AM
Re: shell script question ..... regarding file size test
I was getting very strange errors trying to use the -s with the c shell.
Can I ask you where you found out that the -s was not valid with the c shell?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО08-11-2004 07:39 AM
тАО08-11-2004 07:39 AM
Re: shell script question ..... regarding file size test
HTH
-- Rod Hills