Scripting (was Re: Cron job for backup)

Page principale
Attachements:
Message en tant que courrier électronique
+ (text/plain)
Supprimer ce message
Répondre à ce message
Auteur: Matrix Mole
Date:  
À: Main PLUG discussion list
Anciens-sujets: Re: Cron job for backup
Sujet: Scripting (was Re: Cron job for backup)
der.hans wrote:
> Am 11. Dec, 2007 schwätzte Patrick Fleming, EA so:
>
>> BACKUPDIRNAME=`date +Y%m%d%` #these are backtics -
>
> Use $( ) format for bash and ksh scripts :).
>
> BACKUPDIRNAME=$( date +Y%m%d% )



I've heard this a couple times now, but never had anyone explain why the
$( ) format is preferred over the back quote in bash scripts. I have
begun to try remembering to use the $( ) format in my scripts now, but I
still find myself using back quotes quite often. So why is back quotes
not considered a good method of shelling out a command to the system?

Matrix Mole
---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.PLUG.phoenix.az.us/mailman/listinfo/plug-discuss