[CentOS] bash script reading directory with while and do
Elias Persson
delreich at takeit.seWed May 28 15:12:12 UTC 2014
- Previous message: [CentOS] bash script reading directory with while and do
- Next message: [CentOS] bash script reading directory with while and do
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
On 2014-05-28 15:35, m.roth at 5-cent.us 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> >> A few things: > <snip> >> 3. Your `tar` stanza is wrong (if it's not obvious to you why that is, >> now is a good time to make a habit of using long options >> (e.g. `--gzip`) whenever possible). > > Why long? > <snip> > mark 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.
- Previous message: [CentOS] bash script reading directory with while and do
- Next message: [CentOS] bash script reading directory with while and do
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
More information about the CentOS mailing list