<?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: A strange script problem? in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442865#M15359</link>
    <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;WORK_DIR=`eval echo /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}`&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;</description>
    <pubDate>Wed, 15 Dec 2004 07:01:19 GMT</pubDate>
    <dc:creator>Michael Schulte zur Sur</dc:creator>
    <dc:date>2004-12-15T07:01:19Z</dc:date>
    <item>
      <title>A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442856#M15350</link>
      <description>I just write such a shell script to backup my working directories:&lt;BR /&gt;&lt;BR /&gt;#!/bin/bash&lt;BR /&gt;&lt;BR /&gt;WORK_DIR="/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}"&lt;BR /&gt;DEVICE_FILE="/mnt/back/backup_work_`date +%F`_"&lt;BR /&gt;DATE_TAG="work_full-back-date.tag"&lt;BR /&gt;BACK_LIST="/tmp/work_backlist"&lt;BR /&gt;&lt;BR /&gt;if [ "$1" == "-full" ]; then&lt;BR /&gt;    DEVICE_FILE=$DEVICE_FILE"full.tar.gz"&lt;BR /&gt;    tar -c -f $DEVICE_FILE $WORK_DIR -z&lt;BR /&gt;    chmod 600 $DATE_TAG&lt;BR /&gt;    echo "`date +%F` full" &amp;gt; $DATE_TAG&lt;BR /&gt;    chmod 400 $DATE_TAG&lt;BR /&gt;else&lt;BR /&gt;    DEVICE_FILE=$DEVICE_FILE"inc.tar.gz"&lt;BR /&gt;    echo $DEVICE_FILE &lt;BR /&gt;    echo $WORK_DIR&lt;BR /&gt;    find $WORK_DIR -newer $DATE_TAG &amp;gt; $BACK_LIST&lt;BR /&gt;    tar -c -T $BACK_LIST -f $DEVICE_FILE -z&lt;BR /&gt;    rm $BACK_LIST&lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;But it report:&lt;BR /&gt;tar: /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}: Cannot stat: No such file or directory&lt;BR /&gt;or:&lt;BR /&gt;find: /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}: No such file or directory&lt;BR /&gt;&lt;BR /&gt;But if I run the tar/find command handly, it's OK? I don't know why?&lt;BR /&gt;&lt;BR /&gt;Is any one can help me? thank you.</description>
      <pubDate>Tue, 14 Dec 2004 04:56:11 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442856#M15350</guid>
      <dc:creator>Chowroc</dc:creator>
      <dc:date>2004-12-14T04:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442857#M15351</link>
      <description>Hi Chowroc,&lt;BR /&gt;&lt;BR /&gt;did you tried to run the script in debug mode, i.e.,&lt;BR /&gt;&lt;BR /&gt;#sh -x script.name&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;??&lt;BR /&gt;&lt;BR /&gt;Report news to us.&lt;BR /&gt;&lt;BR /&gt;Regards,&lt;BR /&gt;Xyko</description>
      <pubDate>Tue, 14 Dec 2004 06:51:02 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442857#M15351</guid>
      <dc:creator>xyko_1</dc:creator>
      <dc:date>2004-12-14T06:51:02Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442858#M15352</link>
      <description>try to use single quote for shell globbing.&lt;BR /&gt;&lt;BR /&gt;ex:&lt;BR /&gt;workdir='/{tmp,etc}'&lt;BR /&gt;&lt;BR /&gt;EF</description>
      <pubDate>Tue, 14 Dec 2004 07:38:32 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442858#M15352</guid>
      <dc:creator>Emir Faisal</dc:creator>
      <dc:date>2004-12-14T07:38:32Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442859#M15353</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;according to man bash no quotes can be used with brace expansion i.e.&lt;BR /&gt;WORK_DIR=/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 10:43:45 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442859#M15353</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-12-14T10:43:45Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442860#M15354</link>
      <description>I run the commands handly like this:&lt;BR /&gt;(1) $tar cfz archive.tar.gz DIR/{file1,file2,...}&lt;BR /&gt;$find DIR/{file1,file2,...}&lt;BR /&gt;&lt;BR /&gt;(2) $tar cfz archive.tar.gz 'DIR/{file1,file2,...}'&lt;BR /&gt;$find 'DIR/{file1,file2,...}'&lt;BR /&gt;&lt;BR /&gt;(1) is OK, (2) can't find the files. &lt;BR /&gt;&lt;BR /&gt;I use the way Michael Schulte said, problem still.&lt;BR /&gt;&lt;BR /&gt;so I use #sh -x script.name to see my script,&lt;BR /&gt;I saw when tar/find execute, it add '' automatically, how I can strip that ?&lt;BR /&gt;&lt;BR /&gt;Thank you very much.&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 13:06:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442860#M15354</guid>
      <dc:creator>Chowroc</dc:creator>
      <dc:date>2004-12-14T13:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442861#M15355</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;the find works for me. What error do you get? There should be no '&lt;BR /&gt;Did you delete them from the script?&lt;BR /&gt;Can you post the output of bash -x script?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 13:23:01 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442861#M15355</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-12-14T13:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442862#M15356</link>
      <description>so, just like this:&lt;BR /&gt;# sh -x back_work.sh&lt;BR /&gt;&lt;BR /&gt;+ WORK_DIR=/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}&lt;BR /&gt;++ date +%F&lt;BR /&gt;+ DEVICE_FILE=/mnt/back/backup_work_2004-12-15_&lt;BR /&gt;+ DATE_TAG=work_full-back-date.tag&lt;BR /&gt;+ BACK_LIST=/tmp/work_backlist&lt;BR /&gt;+ '[' '' == -full ']'&lt;BR /&gt;+ DEVICE_FILE=/mnt/back/backup_work_2004-12-15_inc.tar.gz&lt;BR /&gt;+ echo /mnt/back/backup_work_2004-12-15_inc.tar.gz&lt;BR /&gt;/mnt/back/backup_work_2004-12-15_inc.tar.gz&lt;BR /&gt;+ echo '/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}'&lt;BR /&gt;/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}&lt;BR /&gt;+ find '/mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}' -newer work_full-back-date.tag&lt;BR /&gt;find: /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}: No such file or directory&lt;BR /&gt;+ tar -c -T /tmp/work_backlist -f /mnt/back/backup_work_2004-12-15_inc.tar.gz -z&lt;BR /&gt;+ rm /tmp/work_backlist&lt;BR /&gt;</description>
      <pubDate>Tue, 14 Dec 2004 13:47:52 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442862#M15356</guid>
      <dc:creator>Chowroc</dc:creator>
      <dc:date>2004-12-14T13:47:52Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442863#M15357</link>
      <description>Simple test:&lt;BR /&gt;&lt;BR /&gt;# touch /root/file1&lt;BR /&gt;# touch /root/file2&lt;BR /&gt;&lt;BR /&gt;# echo /root/{file1,file2}&lt;BR /&gt;&amp;gt; /root/file1 /root/file2&lt;BR /&gt;# blah="/root/{file1,file2}"&lt;BR /&gt;# echo ${blah}&lt;BR /&gt;&amp;gt; /root/{file1,file2}&lt;BR /&gt;# blah='/root/{file1,file2}'&lt;BR /&gt;# echo ${blah}&lt;BR /&gt;&amp;gt; /root/{file1,file2}&lt;BR /&gt;# blah=/root/{file1,file2}&lt;BR /&gt;# echo ${blah}&lt;BR /&gt;&amp;gt; /root/{file1,file2}&lt;BR /&gt;&lt;BR /&gt;So it would appear that expanding a {} based glob from a variable doesn't work.&lt;BR /&gt;&lt;BR /&gt;Yet:&lt;BR /&gt;&lt;BR /&gt;# blah='/root/file?'&lt;BR /&gt;# echo ${blah}&lt;BR /&gt;&amp;gt; /root/file1 /root/file2&lt;BR /&gt;# blah='/root/file*'&lt;BR /&gt;# echo ${blah}&lt;BR /&gt;&amp;gt; /root/file1 /root/file2&lt;BR /&gt;&lt;BR /&gt;does work.&lt;BR /&gt;&lt;BR /&gt;Limitation of the shell it seems.  I can't find any reference to expansion of globs after being stored in a variable however.</description>
      <pubDate>Tue, 14 Dec 2004 19:37:48 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442863#M15357</guid>
      <dc:creator>Stuart Browne</dc:creator>
      <dc:date>2004-12-14T19:37:48Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442864#M15358</link>
      <description>It means that i must specify every directory separately.&lt;BR /&gt;&lt;BR /&gt;thank you very much.</description>
      <pubDate>Tue, 14 Dec 2004 21:46:05 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442864#M15358</guid>
      <dc:creator>Chowroc</dc:creator>
      <dc:date>2004-12-14T21:46:05Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442865#M15359</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;try this&lt;BR /&gt;WORK_DIR=`eval echo /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}`&lt;BR /&gt;&lt;BR /&gt;greetings,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Wed, 15 Dec 2004 07:01:19 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442865#M15359</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-12-15T07:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442866#M15360</link>
      <description>Yes, just `eval echo /mnt/file/work/{doc03,__Download,gcc,java,js,lnx_sys_config,sh,src,sum,TeX,__webs}` works.&lt;BR /&gt;&lt;BR /&gt;thanks for your help.</description>
      <pubDate>Wed, 15 Dec 2004 11:58:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442866#M15360</guid>
      <dc:creator>Chowroc</dc:creator>
      <dc:date>2004-12-15T11:58:12Z</dc:date>
    </item>
    <item>
      <title>Re: A strange script problem?</title>
      <link>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442867#M15361</link>
      <description>Hi,&lt;BR /&gt;&lt;BR /&gt;if this helped, could you please take a moment and assign points to those who tried?&lt;BR /&gt;&lt;BR /&gt;thanks,&lt;BR /&gt;&lt;BR /&gt;Michael&lt;BR /&gt;&lt;A href="http://forums1.itrc.hp.com/service/forums/helptips.do?#28" target="_blank"&gt;http://forums1.itrc.hp.com/service/forums/helptips.do?#28&lt;/A&gt;</description>
      <pubDate>Wed, 15 Dec 2004 12:06:15 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/a-strange-script-problem/m-p/3442867#M15361</guid>
      <dc:creator>Michael Schulte zur Sur</dc:creator>
      <dc:date>2004-12-15T12:06:15Z</dc:date>
    </item>
  </channel>
</rss>

