<?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: please help interpret script in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783577#M77835</link>
    <description>Wodish,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. I was wondering if you help interpret the block of code below, taken from the script. &lt;BR /&gt;&lt;BR /&gt;I do not quite understand the statement about the combination of grep and sed. &lt;BR /&gt;&lt;BR /&gt;### NEED HELP HERE TILL THE END !!!!! ################ &lt;BR /&gt;&lt;BR /&gt;    my_exclude_options=`cat $RSYNC_DATA_DIR/$EXCLUDE_FILE|grep -v '^'#|grep $dirs|sed "s/^archive\/$dirs\///g"`&lt;BR /&gt;    &lt;BR /&gt;&lt;BR /&gt;    # If we want to use the switch "--exclude-from="    &lt;BR /&gt;    my_exclude_file="/var/tmp/${dirs}_excluded_file"&lt;BR /&gt;    if [ -f $my_exclude_file -o -d $my_exclude_file ]; then&lt;BR /&gt;        /bin/rm -fr $my_exclude_file&lt;BR /&gt;    fi&lt;BR /&gt;    touch $my_exclude_file&lt;BR /&gt;    for file in $my_exclude_options&lt;BR /&gt;    do&lt;BR /&gt;        echo $file &amp;gt;&amp;gt; $my_exclude_file&lt;BR /&gt;    done&lt;BR /&gt;&lt;BR /&gt;    EXCLUDE_OPTIONS="--exclude-from=$my_exclude_file"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
    <pubDate>Sun, 11 Aug 2002 23:00:25 GMT</pubDate>
    <dc:creator>Chern Jian Leaw</dc:creator>
    <dc:date>2002-08-11T23:00:25Z</dc:date>
    <item>
      <title>please help interpret script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783575#M77833</link>
      <description>Hi,&lt;BR /&gt;I have the script attached which I found from some website. It does not have documentation on it and the comments are not very helpful. &lt;BR /&gt;&lt;BR /&gt;It's basically suppose to rsync a group of filesystems from 1 host machine onto another host machine having the same filesytem structure. &lt;BR /&gt;&lt;BR /&gt;Can someone please help me interpret the portions in the script which have comments in uppercases?&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 11 Aug 2002 08:14:31 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783575#M77833</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-11T08:14:31Z</dc:date>
    </item>
    <item>
      <title>Re: please help interpret script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783576#M77834</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the part you marked is only about options. That loop is entered if and only if the script was started with command-line parameters - some of them might be options, some might be data.&lt;BR /&gt;"getopt" is a useful function to parse the command-line (i.e. $* are the words of the command-line following your script's name) for options (i.e. starting with a "-" = minus). &lt;BR /&gt;The only options that script is interested in are the single-character options "d", and "h", and "n".&lt;BR /&gt;If one is found, a shell-variable is set appropriately and then it is deleted from the parameter-list (upon "-h" the script exits, of course).&lt;BR /&gt;&lt;BR /&gt;As an example take the command-line like this:&lt;BR /&gt;&lt;BR /&gt;script -d -n aaa bbb ccc&lt;BR /&gt;&lt;BR /&gt;Then that loop turns it into:&lt;BR /&gt;&lt;BR /&gt;script aaa bbb ccc&lt;BR /&gt;&lt;BR /&gt;but now the shell-variables $RSYNC_DEBUG and $RSYNC_DRY_RUN are set (they were empty before).&lt;BR /&gt;&lt;BR /&gt;So the rest of your script can use "$*" without having to care about options any more.&lt;BR /&gt;&lt;BR /&gt;HTH,&lt;BR /&gt;Wodisch&lt;BR /&gt;</description>
      <pubDate>Sun, 11 Aug 2002 16:59:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783576#M77834</guid>
      <dc:creator>Wodisch_1</dc:creator>
      <dc:date>2002-08-11T16:59:35Z</dc:date>
    </item>
    <item>
      <title>Re: please help interpret script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783577#M77835</link>
      <description>Wodish,&lt;BR /&gt;&lt;BR /&gt;Thanks for the reply. I was wondering if you help interpret the block of code below, taken from the script. &lt;BR /&gt;&lt;BR /&gt;I do not quite understand the statement about the combination of grep and sed. &lt;BR /&gt;&lt;BR /&gt;### NEED HELP HERE TILL THE END !!!!! ################ &lt;BR /&gt;&lt;BR /&gt;    my_exclude_options=`cat $RSYNC_DATA_DIR/$EXCLUDE_FILE|grep -v '^'#|grep $dirs|sed "s/^archive\/$dirs\///g"`&lt;BR /&gt;    &lt;BR /&gt;&lt;BR /&gt;    # If we want to use the switch "--exclude-from="    &lt;BR /&gt;    my_exclude_file="/var/tmp/${dirs}_excluded_file"&lt;BR /&gt;    if [ -f $my_exclude_file -o -d $my_exclude_file ]; then&lt;BR /&gt;        /bin/rm -fr $my_exclude_file&lt;BR /&gt;    fi&lt;BR /&gt;    touch $my_exclude_file&lt;BR /&gt;    for file in $my_exclude_options&lt;BR /&gt;    do&lt;BR /&gt;        echo $file &amp;gt;&amp;gt; $my_exclude_file&lt;BR /&gt;    done&lt;BR /&gt;&lt;BR /&gt;    EXCLUDE_OPTIONS="--exclude-from=$my_exclude_file"&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Thanks.</description>
      <pubDate>Sun, 11 Aug 2002 23:00:25 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783577#M77835</guid>
      <dc:creator>Chern Jian Leaw</dc:creator>
      <dc:date>2002-08-11T23:00:25Z</dc:date>
    </item>
    <item>
      <title>Re: please help interpret script</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783578#M77836</link>
      <description>Hi&lt;BR /&gt;&lt;BR /&gt;The line :-&lt;BR /&gt;&lt;BR /&gt;my_exclude_options=`cat $RSYNC_DATA_DIR/$EXCLUDE_FILE|grep -v '^'#|grep $dirs|sed "s/^archive\/$dirs\///g"` &lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The grep -v is excluding  ('^'#|) see man grep  and the attached will help with sed.&lt;BR /&gt;&lt;BR /&gt;Paula</description>
      <pubDate>Mon, 12 Aug 2002 06:41:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/please-help-interpret-script/m-p/2783578#M77836</guid>
      <dc:creator>Paula J Frazer-Campbell</dc:creator>
      <dc:date>2002-08-12T06:41:00Z</dc:date>
    </item>
  </channel>
</rss>

