- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Problem 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
04-25-2002 06:32 AM
04-25-2002 06:32 AM
Problem With Script
how to script. I'm using the Bourne shell
and can't seem to get my variables to accept values other than strings.
Example:
#!/bin/sh
day='date+%a'
echo $day
Result: date+%a
What am I doing wrong?
Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:37 AM
04-25-2002 06:37 AM
Re: Problem With Script
The better answer is to use the POSIX shell convention
DAY=$(date '+%a')
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:37 AM
04-25-2002 06:37 AM
Re: Problem With Script
And make sure you are using the command substitution quotes.
day=`date +%a`
echo $day
-Sri
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 06:58 AM
04-25-2002 06:58 AM
Re: Problem With Script
DAY=`date +%d`
few more variable initiliztion
HOSTNAME=`uname -n`
FILE="/usr/local/etc/filename"
RUNNING=`ps -e |grep sleep |wc -l`
system is down.
RESULT=`/etc/ping system1 64 3 | grep "packet loss" | sed 's/%//g' | awk '{print
$7}'`
if [ $RESULT -ge 100 ]; then
mailx -s "system1 is down `date`" sachin < /dev/null
exit
fi
arithmatic.
total_min=`expr ${SECONDS} / 60`
Sachin
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
04-25-2002 07:14 AM
04-25-2002 07:14 AM
Re: Problem With Script
I would normally use:
#!/bin/sh
day=`date "+%a"`
echo $day
Thu
Thanks,
Shabu