- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: what wrong with this 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
07-03-2002 11:25 PM
07-03-2002 11:25 PM
I exec follow script
control=$(cat /tmp/scripts/numero_lineas.log |wc -l)
actual=$(cat /tmp/scripts/numero_lineas.txt)
if [ $control -gt $actual ];then
echo "New lines in logfile"
echo $control > /tmp/scripts/numero_lineas.txt
fi
but error appear:: [3]: test: The specified number is not valid for this command.
how to do with it?
Thanks
Sunny
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2002 11:28 PM
07-03-2002 11:28 PM
SolutionYou forgot the |wc -l on the line starting;
actual=
It should look like;
actual=$(cat /tmp/scripts/numero_lineas.txt|wc -l)
Then the test (if ..-gt) will work as its comparing 2 numbers.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2002 11:31 PM
07-03-2002 11:31 PM
Re: what wrong with this script?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-03-2002 11:35 PM
07-03-2002 11:35 PM
Re: what wrong with this script?
I can see what youre doing now, the actual line is supposed to equal what is in the file numero_lineas.txt (which should contain 1 line which has a number). However, when you do your first test does this file have any content ? It should contain only 1 line with a number in it, eg. echo 1 > numero_lineas.txt
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
07-04-2002 10:34 PM
07-04-2002 10:34 PM
Re: what wrong with this script?
i have one script that does something similar.
(see attachment)
Hope it helps
Cheers
Yogeeraj