View previous topic :: View next topic |
Author |
Message |
LAj Apprentice


Joined: 22 May 2004 Posts: 294 Location: Avellino[Italy]
|
Posted: Tue Oct 17, 2006 11:32 pm Post subject: [SOLVED] cp da script e permessi su un file |
|
|
Una cosa semplice all'apparenza
ma forse a quest'ora mi sfugge qualcosa.
Spiegatemi questo:
ho creato uno script per copiare i file di un utente nelle mie cartelle root!
il mio script è eseguito da root che ne è il proprietario
e sui file ci sono i permessi in lettura,
PERCHE' lo script in esecuzione non ha il permesso di lettura???
Scusate, forse domani capirò
Notte. _________________ They produce notes of any size as their own properties askng interests also.This is seignorage and goes to privates banks(FED, BCE).You don't have to pay to use $$,you can simply use your notes recovering monetary sovereignty.Public debt is not right!
Last edited by LAj on Wed Oct 18, 2006 9:20 am; edited 2 times in total |
|
Back to top |
|
 |
lavish Bodhisattva

Joined: 13 Sep 2004 Posts: 4296
|
Posted: Wed Oct 18, 2006 5:43 am Post subject: |
|
|
Uh? Non ho mica capito cosa significa "PERCHE' lo script in esecuzione non ha il permesso di lettura???"
Puoi spiegarti meglio per favore? _________________ minimalblue.com | secgroup.github.io/ |
|
Back to top |
|
 |
LAj Apprentice


Joined: 22 May 2004 Posts: 294 Location: Avellino[Italy]
|
Posted: Wed Oct 18, 2006 7:52 am Post subject: |
|
|
Ciao, ( grazie)
in effetti:
Code: | NeXT ~ # declare PREF="~oriana/"
NeXT ~ # declare UNA=".e/e/applications/menu/favorite/.order"
NeXT ~ # cp ~oriana/.e/e/applications/menu/favorite/.order .e/e/applications/menu/favorite/.order
NeXT ~ # echo -l FUNZIONA
NeXT ~ # cp $PREF$UNA $UNA
cp: impossibile fare stat di `~oriana/.e/e/applications/menu/favorite/.order': No such file or directory
NeXT ~ # echo -l "PERCHE NON FUNZIONA PUR ESSENDO ESPANSO ALLO STESSO MODO?" |
Bho
Illuminami! _________________ They produce notes of any size as their own properties askng interests also.This is seignorage and goes to privates banks(FED, BCE).You don't have to pay to use $$,you can simply use your notes recovering monetary sovereignty.Public debt is not right! |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Wed Oct 18, 2006 8:09 am Post subject: |
|
|
LAj wrote: | Ciao, ( grazie)
in effetti:
Code: | NeXT ~ # declare PREF="~oriana/"
NeXT ~ # declare UNA=".e/e/applications/menu/favorite/.order"
NeXT ~ # cp ~oriana/.e/e/applications/menu/favorite/.order .e/e/applications/menu/favorite/.order
NeXT ~ # echo -l FUNZIONA
NeXT ~ # cp $PREF$UNA $UNA
cp: impossibile fare stat di `~oriana/.e/e/applications/menu/favorite/.order': No such file or directory
NeXT ~ # echo -l "PERCHE NON FUNZIONA PUR ESSENDO ESPANSO ALLO STESSO MODO?" |
|
eh?
Non capisco se hai scritto in questo modo per qualche ragione particolare o meno, comunque, visto che mi perdo nel leggerlo, prova a fare:
Code: | echo "cp $PREF$UNA $UNA" |
per vedere cosa é stato efettivamente espanso ed eventualmente provare a dare lo stesso comando con copia ed incolla. _________________ Ciao da me! |
|
Back to top |
|
 |
LAj Apprentice


Joined: 22 May 2004 Posts: 294 Location: Avellino[Italy]
|
Posted: Wed Oct 18, 2006 8:37 am Post subject: |
|
|
ho solo messo i commenti nell' echo e omesso l'output di questo comando
ma per tutti gli altri questo è quanto compare sul terminale
cioè:
cp ~oriana/.e/e/applications/menu/favorite/.order .e/e/applications/menu/favorite/.order
non produce output ed infatti funziona
mentre invece
cp $PREF$UNA $UNA ; produce come output:
cp: impossibile fare stat di `~oriana/.e/e/applications/menu/favorite/.order': No such file or directory
quindi cerca di fare stat di esattamente lo stesso file.
Cmq: Code: | NeXT ~ # echo "cp $PREF$UNA $UNA"
cp ~oriana/.e/e/applications/menu/favorite/.order .e/e/applications/menu/favorite/.order
|
_________________ They produce notes of any size as their own properties askng interests also.This is seignorage and goes to privates banks(FED, BCE).You don't have to pay to use $$,you can simply use your notes recovering monetary sovereignty.Public debt is not right! |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Wed Oct 18, 2006 8:53 am Post subject: |
|
|
LAj wrote: | non produce output ed infatti funziona |
Il problema potrebbe essere nella tilde. Prova ad espanderla manualmente. _________________ Ciao da me! |
|
Back to top |
|
 |
LAj Apprentice


Joined: 22 May 2004 Posts: 294 Location: Avellino[Italy]
|
Posted: Wed Oct 18, 2006 8:56 am Post subject: |
|
|
Funziona.
Ma perchè questa cosa? _________________ They produce notes of any size as their own properties askng interests also.This is seignorage and goes to privates banks(FED, BCE).You don't have to pay to use $$,you can simply use your notes recovering monetary sovereignty.Public debt is not right! |
|
Back to top |
|
 |
randomaze Bodhisattva


Joined: 21 Oct 2003 Posts: 9985
|
Posted: Wed Oct 18, 2006 9:17 am Post subject: |
|
|
LAj wrote: | Funziona.
Ma perchè questa cosa? |
La tilde non é qualcosa che viene "capito" dal filesystem, é una convenzione che viene espansa dalla shell.
Allora, se bash si ritrova una linea da espandere evidentemente prima espante le tilde e poi le variabili. Allora se una variabile contiene una tilde questa non sarà espansa.
I vari dettagli sull'ordine di espansione e di interpretazione dovrebbero essere elencati nella man page di bash.
P.S. Hai fatto bene a mettere il tag [risolto], ma la sintesi della soluzione é un pò ecessiva... puoi eliminarla?  _________________ Ciao da me! |
|
Back to top |
|
 |
LAj Apprentice


Joined: 22 May 2004 Posts: 294 Location: Avellino[Italy]
|
Posted: Wed Oct 18, 2006 9:20 am Post subject: |
|
|
E per ricordarmene _________________ They produce notes of any size as their own properties askng interests also.This is seignorage and goes to privates banks(FED, BCE).You don't have to pay to use $$,you can simply use your notes recovering monetary sovereignty.Public debt is not right! |
|
Back to top |
|
 |
|