<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem With Script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711080#M60571</link>
    <description>Hi Shannon,&lt;BR /&gt;DAY=`date +%d`&lt;BR /&gt;&lt;BR /&gt;few more variable initiliztion&lt;BR /&gt;&lt;BR /&gt;HOSTNAME=`uname -n`&lt;BR /&gt;FILE="/usr/local/etc/filename"&lt;BR /&gt;RUNNING=`ps -e |grep sleep |wc -l`&lt;BR /&gt;&lt;BR /&gt;system is down.&lt;BR /&gt;RESULT=`/etc/ping system1 64 3 | grep "packet loss" | sed 's/%//g' | awk '{print &lt;BR /&gt;$7}'`&lt;BR /&gt;if [ $RESULT -ge 100 ]; then&lt;BR /&gt;    mailx -s "system1 is down `date`" sachin &amp;lt; /dev/null&lt;BR /&gt;    exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;arithmatic.&lt;BR /&gt;total_min=`expr ${SECONDS} / 60`&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Thu, 25 Apr 2002 13:58:42 GMT</pubDate>
    <dc:creator>Sachin Patel</dc:creator>
    <dc:date>2002-04-25T13:58:42Z</dc:date>
    <item>
      <title>Problem With Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711077#M60568</link>
      <description>OK, I'm in the beginning stages of learning&lt;BR /&gt;how to script.  I'm using the Bourne shell&lt;BR /&gt;and can't seem to get my variables to accept values other than strings.  &lt;BR /&gt;&lt;BR /&gt;Example: &lt;BR /&gt;&lt;BR /&gt;#!/bin/sh   &lt;BR /&gt;day='date+%a'&lt;BR /&gt;echo $day  &lt;BR /&gt;&lt;BR /&gt;Result: date+%a&lt;BR /&gt;&lt;BR /&gt;What am I doing wrong? &lt;BR /&gt;&lt;BR /&gt;Thanks. &lt;BR /&gt;</description>
      <pubDate>Thu, 25 Apr 2002 13:32:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711077#M60568</guid>
      <dc:creator>Shannon_1</dc:creator>
      <dc:date>2002-04-25T13:32:25Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711078#M60569</link>
      <description>You should be using 'backticks' the ` rather than the single quote '&lt;BR /&gt;&lt;BR /&gt;The better answer is to use the POSIX shell convention&lt;BR /&gt;DAY=$(date '+%a')&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Apr 2002 13:37:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711078#M60569</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2002-04-25T13:37:39Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711079#M60570</link>
      <description>There should be a space between date and +.&lt;BR /&gt;And make sure you are using the command substitution quotes.&lt;BR /&gt;&lt;BR /&gt;day=`date +%a`&lt;BR /&gt;echo $day&lt;BR /&gt;&lt;BR /&gt;-Sri</description>
      <pubDate>Thu, 25 Apr 2002 13:37:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711079#M60570</guid>
      <dc:creator>Sridhar Bhaskarla</dc:creator>
      <dc:date>2002-04-25T13:37:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711080#M60571</link>
      <description>Hi Shannon,&lt;BR /&gt;DAY=`date +%d`&lt;BR /&gt;&lt;BR /&gt;few more variable initiliztion&lt;BR /&gt;&lt;BR /&gt;HOSTNAME=`uname -n`&lt;BR /&gt;FILE="/usr/local/etc/filename"&lt;BR /&gt;RUNNING=`ps -e |grep sleep |wc -l`&lt;BR /&gt;&lt;BR /&gt;system is down.&lt;BR /&gt;RESULT=`/etc/ping system1 64 3 | grep "packet loss" | sed 's/%//g' | awk '{print &lt;BR /&gt;$7}'`&lt;BR /&gt;if [ $RESULT -ge 100 ]; then&lt;BR /&gt;    mailx -s "system1 is down `date`" sachin &amp;lt; /dev/null&lt;BR /&gt;    exit&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;arithmatic.&lt;BR /&gt;total_min=`expr ${SECONDS} / 60`&lt;BR /&gt;&lt;BR /&gt;Sachin&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Thu, 25 Apr 2002 13:58:42 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711080#M60571</guid>
      <dc:creator>Sachin Patel</dc:creator>
      <dc:date>2002-04-25T13:58:42Z</dc:date>
    </item>
    <item>
      <title>Re: Problem With Script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711081#M60572</link>
      <description>Shanon,&lt;BR /&gt;&lt;BR /&gt;I would normally use:&lt;BR /&gt;&lt;BR /&gt;#!/bin/sh &lt;BR /&gt;day=`date "+%a"` &lt;BR /&gt;echo $day&lt;BR /&gt;&lt;BR /&gt;Thu&lt;BR /&gt;&lt;BR /&gt;Thanks,&lt;BR /&gt;Shabu</description>
      <pubDate>Thu, 25 Apr 2002 14:14:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-script/m-p/2711081#M60572</guid>
      <dc:creator>SHABU KHAN</dc:creator>
      <dc:date>2002-04-25T14:14:24Z</dc:date>
    </item>
  </channel>
</rss>

