[Wylug-help] Sh problem

Towle, William william.towle at echostar.com
Thu Apr 17 11:22:19 BST 2008


>= Anne:
> Here is the actual script:
> sudo /bin/bash
> cd /
> tar cvpzf /media/USB%20Flash%20Memory/partition1/EeePC(date 
> +%F).tar.gz --exclude=/media* --exclude=/proc/* 
> --exclude=/lost+found/* --exclude=/mnt/* --exclude=/sys/* 
> --exclude=/home.* /
> 
> It looks as though it's something to do with the date 
> parameter,but (date +%F) 
> is all on one line, not as it shows here.

  I think you want to add a $ before the open bracket
[ie. $(date +%F)] so that you get the date in the
filename. I suspect the shell is trying to parse that
as three separate commands otherwise, and is
expecting '&' or '|' when it gets to the bracket.

Wills.



More information about the Wylug-help mailing list