- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Re: Syntex erros
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
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
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
10-07-2011 01:25 PM
10-07-2011 01:25 PM
Syntex erros
Hi All,
OS :- HPUS 11.11
I am using following script to compare dates. While executing , it throwing me following errors, since the script not execcuted fully, I am not sure, weather this is right way to compare dates. Also, not sure about the syntex part.
none> ./test.sh ./test.sh[7]: Syntax error at line 7 : `;' is not expected. oradev3 oraadmin /home/oraadmin/test/dev_monitoring none> cat -n test.sh 1 #!/sbin/sh 2 SID=qfin1 3 . qa02 4 typeset -i mHHMM=`date +%H%M` 5 typeset -i mDD=$(date +%d) 6 mDay=`date +%a` 7 if [[ "${mDay}" = "Fri" && ${mHHMM} -gt 1604]]; then 8 echo "Test succeded" 9 fi
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
10-07-2011 02:26 PM
10-07-2011 02:26 PM
Re: Syntex erros
Hi:
You need a space character before the closing square brackets on line-7.
if [[ "${mDay}" = "Fri" && ${mHHMM} -gt 1604 ]]; then
It's better form to avoid the archaic backtick syntax and use the modern Posix standard of $( ... ). You did this line line-5. This improves readability and helps eliminate typos that use a backtick instead of a single quote and vice versa.
Regards!
...JRF...
- Tags:
- command substitution