Re: bash script reading directory with while and do

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]



Elias Persson wrote:
> On 2014-05-28 15:35, m.roth@xxxxxxxxx wrote:
>> Elias Persson wrote:
>>> On 2014-05-25 12:08, Paolo De Michele wrote:> !/bin/bash
> <snip>
>>>>          tar cfz `date +%F`_$NAME.tar.gz web$NR/
> <snip>
>>>
>> Dumb question: why not
> <snip>
>>       tar -czf /backup/www/test/`date +%F`_$NAME.tar.gz web$NR/
<snip>
>> Why long?
>> <snip>
>
> With long options one can't stick something that takes an argument
> in the middle of a bunch of others (which was the error I thought
> was present here, and would have been the case if your example had
> the options in the same order).
> It's also more readily apparent what the options do, though that's
> not much of an issue for common things like tar or rm. I for one can
> never recall if it's -c or -C that's --reuse-message for git commit.

<shrug> Everybody I know knows the short flags.

However, the point I made in the code snippet was, why copy it to a temp
directory, then tar and compress it, then copy it to another directory,
then remove the copy in the temp directory, rather than just tar and
compress it directly to the target directory? I *did* give the full path
the the target, preceding the final filename.

        mark

_______________________________________________
CentOS mailing list
CentOS@xxxxxxxxxx
http://lists.centos.org/mailman/listinfo/centos




[Index of Archives]     [CentOS]     [CentOS Announce]     [CentOS Development]     [CentOS ARM Devel]     [CentOS Docs]     [CentOS Virtualization]     [Carrier Grade Linux]     [Linux Media]     [Asterisk]     [DCCP]     [Netdev]     [Xorg]     [Linux USB]
  Powered by Linux