<?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 Passing two-word input to shell script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953915#M720164</link>
    <description>I have a personalized script that takes inputs using -p, -user, and -role. I am trying to pass a role called "Process Manager" (as in, script.sh -role "Process Manager"), but I only get the first word when I store $1 into a variable (after shifting to it). I have tried with quotes, and without, and each time I just get the first word. &lt;BR /&gt;&lt;BR /&gt;Thank you for any advice!</description>
    <pubDate>Thu, 17 Apr 2003 12:05:49 GMT</pubDate>
    <dc:creator>Scott Downs</dc:creator>
    <dc:date>2003-04-17T12:05:49Z</dc:date>
    <item>
      <title>Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953915#M720164</link>
      <description>I have a personalized script that takes inputs using -p, -user, and -role. I am trying to pass a role called "Process Manager" (as in, script.sh -role "Process Manager"), but I only get the first word when I store $1 into a variable (after shifting to it). I have tried with quotes, and without, and each time I just get the first word. &lt;BR /&gt;&lt;BR /&gt;Thank you for any advice!</description>
      <pubDate>Thu, 17 Apr 2003 12:05:49 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953915#M720164</guid>
      <dc:creator>Scott Downs</dc:creator>
      <dc:date>2003-04-17T12:05:49Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953916#M720165</link>
      <description>hi Scott,&lt;BR /&gt;  You can use getopt in shell scripts.  Check the man page for details.&lt;BR /&gt;&lt;BR /&gt;cheers&lt;BR /&gt;Umapathy&lt;BR /&gt;</description>
      <pubDate>Thu, 17 Apr 2003 12:12:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953916#M720165</guid>
      <dc:creator>Umapathy S</dc:creator>
      <dc:date>2003-04-17T12:12:40Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953917#M720166</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;get it as two variables :-&lt;BR /&gt;&lt;BR /&gt;$1 and $2&lt;BR /&gt;&lt;BR /&gt;then $1+$2 = $3&lt;BR /&gt;&lt;BR /&gt;then pass the variable $3.&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Thu, 17 Apr 2003 12:12:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953917#M720166</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2003-04-17T12:12:47Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953918#M720167</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;$* will give you all the arguments.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;&lt;BR /&gt;Darren.</description>
      <pubDate>Thu, 17 Apr 2003 12:17:30 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953918#M720167</guid>
      <dc:creator>Darren Prior</dc:creator>
      <dc:date>2003-04-17T12:17:30Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953919#M720168</link>
      <description>text with whitespace is processed by the shell as separate words unless it is enclosed in quotes. This is true both for input as well as output. So if your script reads input from the command line, you must protect the whitespace to make it appear as a single string as in:&lt;BR /&gt;&lt;BR /&gt;two strings "one string" one\ more\ string&lt;BR /&gt;&lt;BR /&gt;In the above example, there are 4 strings. "one string" and one\ more\ string will each be assigned to a single variable.</description>
      <pubDate>Thu, 17 Apr 2003 12:17:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953919#M720168</guid>
      <dc:creator>Bill Hassell</dc:creator>
      <dc:date>2003-04-17T12:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953920#M720169</link>
      <description>Just a hint, in case you haven't yet stumbled accross it.&lt;BR /&gt;&lt;BR /&gt;Have a look at the getopt program (see its manpage).&lt;BR /&gt;It makes parsing of commandline switches so much easier.&lt;BR /&gt;&lt;BR /&gt;Basically, quoting strings that contain whitespace (e.g.  "Process Manager"), or quoting each whitespace (e.g. Process\ Mangare) should deliver the argument as one token.</description>
      <pubDate>Thu, 17 Apr 2003 12:18:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953920#M720169</guid>
      <dc:creator>Ralph Grothe</dc:creator>
      <dc:date>2003-04-17T12:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953921#M720170</link>
      <description>hi,&lt;BR /&gt;&lt;BR /&gt;if the script is called like this -&lt;BR /&gt;&lt;BR /&gt;$ script.sh -p xxx -user yyy -role "hello world!"&lt;BR /&gt;&lt;BR /&gt;then add this line to your script -&lt;BR /&gt;&lt;BR /&gt;IFS='"' # IFS=internal field separator&lt;BR /&gt;&lt;BR /&gt;works for me.&lt;BR /&gt;&lt;BR /&gt;HTH.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Thu, 17 Apr 2003 12:22:56 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953921#M720170</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-17T12:22:56Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953922#M720171</link>
      <description>that's a double quote (") within 2 single quotes (') btw.&lt;BR /&gt;&lt;BR /&gt;- ramd.</description>
      <pubDate>Thu, 17 Apr 2003 12:26:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953922#M720171</guid>
      <dc:creator>Ramkumar Devanathan</dc:creator>
      <dc:date>2003-04-17T12:26:52Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953923#M720172</link>
      <description>script optionone optiontwo option three&lt;BR /&gt;&lt;BR /&gt;optionvar1=$1&lt;BR /&gt;optionvar2=$2&lt;BR /&gt;optionvar3="$3 $4"&lt;BR /&gt;&lt;BR /&gt;This should work as well&lt;BR /&gt;it sets a variable = to the command line options</description>
      <pubDate>Fri, 18 Apr 2003 12:23:39 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953923#M720172</guid>
      <dc:creator>John Meissner</dc:creator>
      <dc:date>2003-04-18T12:23:39Z</dc:date>
    </item>
    <item>
      <title>Re: Passing two-word input to shell script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953924#M720173</link>
      <description>Hi,&lt;BR /&gt;when you make the variable assignment of $1 in your script, is $1 qouted? It should be.&lt;BR /&gt;&lt;BR /&gt;regards,&lt;BR /&gt;John K.&lt;BR /&gt;</description>
      <pubDate>Fri, 18 Apr 2003 16:41:29 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/passing-two-word-input-to-shell-script/m-p/2953924#M720173</guid>
      <dc:creator>john korterman</dc:creator>
      <dc:date>2003-04-18T16:41:29Z</dc:date>
    </item>
  </channel>
</rss>

