<?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: shift command! in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133200#M93170</link>
    <description>&lt;P&gt;&amp;gt;Laurent: then something like: SAVEARGS="$*"&lt;BR /&gt;&lt;BR /&gt;The proper way to save args is:&lt;BR /&gt;set -A SAVEARGS -- "$@"&lt;BR /&gt;&lt;BR /&gt;The proper way to reset them is:&lt;BR /&gt;set -- "${SAVEARGS[@]}"&lt;/P&gt;</description>
    <pubDate>Tue, 27 Sep 2011 20:42:32 GMT</pubDate>
    <dc:creator>Dennis Handly</dc:creator>
    <dc:date>2011-09-27T20:42:32Z</dc:date>
    <item>
      <title>Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133193#M93163</link>
      <description>Hi everybody,&lt;BR /&gt;&lt;BR /&gt;I am facing problem with the shift command.&lt;BR /&gt;&lt;BR /&gt;I have 3 shell scripts:&lt;BR /&gt;1.Master.ksh&lt;BR /&gt;2.Intermediate.ksh&lt;BR /&gt;3.Final.ksh&lt;BR /&gt;&lt;BR /&gt;The Master.ksh is calling Intermediate.ksh first and then calling Final.ksh.&lt;BR /&gt;In intermediate.ksh, at the end shift command is used.&lt;BR /&gt;Final.ksh is expecting a parameter to be passed to it.&lt;BR /&gt;Now because of this shift command, the Final.ksh is not recognising the parameter passed to it.&lt;BR /&gt;I cannot change intermediate.ksh script, and Final.ksh has to take a parameter.&lt;BR /&gt;Please help me how I can resolve this issue.</description>
      <pubDate>Tue, 22 Jan 2008 03:52:36 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133193#M93163</guid>
      <dc:creator>Rinky</dc:creator>
      <dc:date>2008-01-22T03:52:36Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133194#M93164</link>
      <description>If you can't change the intermediate shell then you cannot remove the shift. You did not say that you couldn't change the Master.ksh script. I would capture the parameter in question, set a variable and export it and then use the exported variable in Final.ksh. &lt;BR /&gt;&lt;BR /&gt;Plan B. Whatever the last argument is that you send to Master.ksh (or whatever the last argument that Master.ksh uses when intermediate.ksh is called) should be captured in a variable and sent to intermediate.ksh twice. That way, the shift will remove one but not the final argument.</description>
      <pubDate>Tue, 22 Jan 2008 04:52:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133194#M93164</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2008-01-22T04:52:40Z</dc:date>
    </item>
    <item>
      <title>Re: shift command!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133195#M93165</link>
      <description>&lt;P&gt;&amp;gt;The Master.ksh is calling Intermediate.ksh first and then calling Final.ksh.&lt;BR /&gt;&lt;BR /&gt;Master calls intermediate and then master calls final? Or intermediate calls final?&lt;BR /&gt;&lt;BR /&gt;&amp;gt;In intermediate.ksh, at the end shift command is used.&lt;BR /&gt;&lt;BR /&gt;A shift in intermediate.ksh can't change the parms in Master.ksh, my first assumption.&lt;BR /&gt;&lt;BR /&gt;&amp;gt;I cannot change intermediate.ksh script, and Final.ksh has to take a parameter.&lt;BR /&gt;&lt;BR /&gt;It would help if we had an example of Master.ksh and how the parms are moved around.&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 20:41:43 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133195#M93165</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-27T20:41:43Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133196#M93166</link>
      <description>are you sourcing the different shells?&lt;BR /&gt;( . ./Intermediate.ksh )&lt;BR /&gt;then something like:&lt;BR /&gt;SAVARGS="$*"&lt;BR /&gt;. ./Intermediate.ksh&lt;BR /&gt;set -- "$SAVARGS"&lt;BR /&gt;&lt;BR /&gt;. ./Final.ksh&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 22 Jan 2008 12:51:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133196#M93166</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2008-01-22T12:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133197#M93167</link>
      <description>Call the master script with the last argument duplicated: in stead of&lt;BR /&gt;Master a b c &lt;BR /&gt;do&lt;BR /&gt;Master a b c c &lt;BR /&gt;&lt;BR /&gt;Maybe you are calling the Master script incorrectly? &lt;BR /&gt;&lt;BR /&gt;HtH,&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Tue, 22 Jan 2008 18:39:24 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133197#M93167</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2008-01-22T18:39:24Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133198#M93168</link>
      <description>Hmm, &lt;BR /&gt;&lt;BR /&gt;a correction:&lt;BR /&gt;Master calls intermediate, intermediate shifts and exits, master continues and call final.&lt;BR /&gt;The shift in intermediate only affects the argument list passed on to intermedaiate and has no influence on calling the final script.&lt;BR /&gt;&lt;BR /&gt;I just tested this in ksh on Linux.&lt;BR /&gt;&lt;BR /&gt;So your problem is not caused by the intermediate script.&lt;BR /&gt;&lt;BR /&gt;JP</description>
      <pubDate>Tue, 22 Jan 2008 18:54:44 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133198#M93168</guid>
      <dc:creator>Jeroen Peereboom</dc:creator>
      <dc:date>2008-01-22T18:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133199#M93169</link>
      <description>the "master" script must be "sourcing" the "intermediate" script.  in that specific case, the intermediate script is not a sub-shell and therefore can shift the args.&lt;BR /&gt;&lt;BR /&gt;you're going to have to modify the master to save the original arg list, and then call the "final" script w/ the saved args</description>
      <pubDate>Tue, 22 Jan 2008 19:41:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133199#M93169</guid>
      <dc:creator>OldSchool</dc:creator>
      <dc:date>2008-01-22T19:41:14Z</dc:date>
    </item>
    <item>
      <title>Re: shift command!</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133200#M93170</link>
      <description>&lt;P&gt;&amp;gt;Laurent: then something like: SAVEARGS="$*"&lt;BR /&gt;&lt;BR /&gt;The proper way to save args is:&lt;BR /&gt;set -A SAVEARGS -- "$@"&lt;BR /&gt;&lt;BR /&gt;The proper way to reset them is:&lt;BR /&gt;set -- "${SAVEARGS[@]}"&lt;/P&gt;</description>
      <pubDate>Tue, 27 Sep 2011 20:42:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133200#M93170</guid>
      <dc:creator>Dennis Handly</dc:creator>
      <dc:date>2011-09-27T20:42:32Z</dc:date>
    </item>
    <item>
      <title>Re: Shift command! Please help</title>
      <link>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133201#M93171</link>
      <description>You are right works better if you have blanks inside params.&lt;BR /&gt; SAV="$*"&lt;BR /&gt;&lt;BR /&gt;set -- $SAV&lt;BR /&gt;&lt;BR /&gt;for instance  "A B"  "C D"&lt;BR /&gt;with my method will become&lt;BR /&gt;A B C D  ( 4 parameters)&lt;BR /&gt;&lt;BR /&gt;and &lt;BR /&gt;set -- "$SAV" &lt;BR /&gt;will become &lt;BR /&gt;"A B C D" (1 parameter)</description>
      <pubDate>Wed, 23 Jan 2008 09:06:51 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/shift-command-please-help/m-p/4133201#M93171</guid>
      <dc:creator>Laurent Menase</dc:creator>
      <dc:date>2008-01-23T09:06:51Z</dc:date>
    </item>
  </channel>
</rss>

