Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- # Verifica che il numero di argomenti sia almeno 2
- if test $# -lt 3
- then
- echo "Numero di parametri insufficiente"
- exit 1
- fi
- # Imposta la variabile CAR all'ultimo argomento
- CAR=${!#}
- # Verifica che ciascun argomento (eccetto l'ultimo) sia un nome assoluto
- for i in "${@:1:$(($#-1))}"
- do
- case $i in
- /*) if test ! -d $i -o ! -x $i
- then echo "$i non è una directory"
- exit 3
- fi;;
- *) echo "$i non è un nome assoluto"
- exit 2;;
- esac
- done
- # Verifica che CAR sia un singolo carattere
- case $CAR in
- ?) ;;
- *) echo "$CAR non è un singolo carattere"
- exit 3;;
- esac
- # Aggiungi la directory corrente alla variabile PATH ed esportala
- PATH=$(pwd):$PATH
- export PATH
- # Esegui lo script FCR2024.sh per ciascun argomento
- for abs in "${@:1:$(($#-1))}"
- do
- echo "Stiamo esplorando $abs"
- FCR2024.sh "$abs" "$CAR"
- done
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement