Perchè questo funziona:
e questo no?codice:type="d" find . -type $type
Mi dice proprio "find: predicato `-type d' non valido"codice:type="-type d" find . $type
Perchè questo funziona:
e questo no?codice:type="d" find . -type $type
Mi dice proprio "find: predicato `-type d' non valido"codice:type="-type d" find . $type
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
L'espressione esatta che uso è questa:
codice:type="d" find $radice$target -type $type -exec chmod $flag \{\} \; [OK] type="-type d" find $radice$target $type -exec chmod $flag \{\} \; [ERRORE]
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
mi pare un problema di spazi ... stacca ste' vars e
NON SI USANO NOMI DI COMANDI BUILT-IN COME NOMI DI VARIABILE
type e' un comando...
e metti -x nell'invocazione di shell che debugghi...e vedi che gli stai a passa'...
buon div
pierluigi
z00keeper of
www.z00.it
www.slack.z00.it
Non è un problema di spazi perchè la prima versione è identica e funziona, inoltre quelle due stringhe devono essere concatenate. Ho provato cmq anche togliendone una. Il nome era provvisorio e avevo già provato a cambiarlo senza risultati
Cmq con sh -x :
Pare che mi metta quegli apici ('-type d')... e che il problema sia lì... ma perchè lo fa? Non ho idea di come risolvere...codice:taip="-type d" find $radice $taip -exec chmod $flag \{\} \; ... + find ./tmp/due/ '-type d' -exec chmod g+w- '{}' ';' find: predicato `-type d' non valido
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
strano qui su' slack curr bash 2.05b no problem financo usando type...
primo tent: sembra che interpreti male...impostare la var con singoli apici per forzare il letterale tipo='-type d'
secondo tent: recupera con ${tipo} il valore
non riusciendo a avere quell'errore vado a tentativi....
ma stai usando sh o bash ?
pierluigi
se serve al volo sto' su
telnet www.slack.z00.it 6666
entra come guest....
z00keeper of
www.z00.it
www.slack.z00.it
Avevo già provato anche ='-type d' ma nulla; ora ho provato anche ${} ma ancora niente.
Anch'io uso bash 2.05b
il fatto è che effettivamente da console mi funziona
Ma nello script no... non posso postarlo tutto perchè è lunghetto... non so dove possa essere il casotto... cmq le parti più incriminate son queste:codice:taip="-type d"; find ./tmp/due/ $taip
codice:(" Applica solo sulle directory") tipo="directory" taip='-type d' echo -en "\n Premi un tasto per continuare " read break ;; (" Permessi gruppo") controllaValidita echo " Imposta i permessi per il gruppo" source ./opz3_4.sh flag="g"$flag find $radice ${taip} -exec chmod $flag \{\} \; echo " Permessi $flag conferiti in $target per il gruppo" echo -en "\n Premi un tasto per continuare " read break ;;
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
up...
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
ri-up
Debian GNU/Linux sid
Publishing a theory should not be the end of one's conversation with the universe, but the beginning. (Eric S. Raymond)
Kernel 2.6.14-ck1
Ho provato, a me non dà nessun errore...