- Codice: Seleziona tutto
#!/bin/sh
OPTIONS="-avz --delete-after --delete-excluded"
INCLUDE="--include='*/' --include='*.tgz'"
EXCLUDE="--exclude='kdei/' --exclude='*'"
SOURCE="slackware.mirrors.tds.net::slackware/slackware-current/slackware/"
DEST="./current/"
case $1 in
-c ) echo "/usr/bin/rsync $OPTIONS --dry-run $INCLUDE $EXCLUDE $SOURCE $DEST" ;;
-d ) echo "/usr/bin/rsync $OPTIONS $INCLUDE $EXCLUDE $SOURCE $DEST" ;;
* )
echo "Usage: $(basename $0) [OPTION]..."
echo -e " -c\t check for updates"
echo -e " -d\t download updates"
exit ;;
esac
- Codice: Seleziona tutto
$ ./current.sh -c
/usr/bin/rsync -avz --delete-after --delete-excluded --dry-run --include='/*/' --include='*.tgz' --exclude='kdei/' --exclude='*' slackware.mirrors.tds.net::slackware/slackware-current/slackware/ ./current/
Invece se lancio il comando tramite lo script togliendo gli echo mi include tutti i file.
- Codice: Seleziona tutto
#!/bin/sh
OPTIONS="-avz --delete-after --delete-excluded"
INCLUDE="--include='*/' --include='*.tgz'"
EXCLUDE="--exclude='kdei/' --exclude='*'"
SOURCE="slackware.mirrors.tds.net::slackware/slackware-current/slackware/"
DEST="./current/"
case $1 in
-c ) /usr/bin/rsync $OPTIONS --dry-run $INCLUDE $EXCLUDE $SOURCE $DEST ;;
-d ) /usr/bin/rsync $OPTIONS $INCLUDE $EXCLUDE $SOURCE $DEST ;;
* )
echo "Usage: $(basename $0) [OPTION]..."
echo -e " -c\t check for updates"
echo -e " -d\t download updates"
exit ;;
esac
Ho provato a incollare il comando sia in zsh, sia in bash, sia in sh, e funziona sempre.
Ma non lanciando lo script.
Qualcuno mi sa dare una spiegazione?
Grazie



