Gentoo Forums
Gentoo Forums
Gentoo Forums
Quick Search: in
[bash] problemi di path? No, io rinco [risolto]
View unanswered posts
View posts from last 24 hours
View posts from last 7 days

 
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian)
View previous topic :: View next topic  
Author Message
flocchini
Veteran
Veteran


Joined: 17 May 2003
Posts: 1124
Location: Milano, Italy

PostPosted: Thu Nov 10, 2005 11:26 am    Post subject: [bash] problemi di path? No, io rinco [risolto] Reply with quote

devo eseguire uno script bash (non uno a caso, e' cozzepolenta di xchris che funziona perfettamente su diverse macchine) che contiene la seguente istruzione

Code:

./binutils/unix2dos $ROUTE_UP_REMOTE_WINDOWS 2>/dev/null


cosi' come molte altre con "." all'inizio che immagino significhi di partire dalla directory nella quale si e' e andare a pescare il comando specificato nella sottodirectory binutils/unix2dos. Lanciando quindi lo script da "/root/cozze-polenta" , mi aspetto che lui esegua "/root/cozze-polenta/binutils/unix2dos" (lavoro da root finche' sono in fase di test onde evitare per ora problemi di permessi/ecc)

il problema e' che su 2 gentoobox funziona perfettamente, su una terza no e lo script non trova il comando... Una soluzione potrebbe essere aggiungere "/root/cozzepolenta/binutils" al path ma visto che sulle altre gentoobox non e' stato necessario non vedo perche' qua ce ne debba essere bisogno, e cmq non funziona uguale visto che per altre istruzioni i comandi sono in directory variabili e quindi non posso inserirli nel path.

Dove vado a sbattere la testa?

gracias :wink:
_________________
~~ Per amore della rosa si sopportano le spine... ~~


Last edited by flocchini on Thu Nov 10, 2005 5:25 pm; edited 1 time in total
Back to top
View user's profile Send private message
Drospy
n00b
n00b


Joined: 29 Aug 2003
Posts: 42
Location: Cosenza, Italy

PostPosted: Thu Nov 10, 2005 4:26 pm    Post subject: Reply with quote

Ciao,

Una domanda stupida, sei sicuro che il comando esista.

Cioè lanciando il comando "ls -l /root/cozzepolenta/binutils/unix2dos" e anche "ls -l ./cozzepolenta/binutils/unix2dos" da errore?

Ciao
Drospy
Back to top
View user's profile Send private message
flocchini
Veteran
Veteran


Joined: 17 May 2003
Posts: 1124
Location: Milano, Italy

PostPosted: Thu Nov 10, 2005 4:34 pm    Post subject: Reply with quote

c'e' eccome...

Code:
cube ~ # ls -l /root/cozze-polenta/binutils/unix2dos
-rwxr-xr-x  1 root root 13388 Sep 22  2003 /root/cozze-polenta/binutils/unix2dos


e

Code:
cube ~ # ls -l ./cozze-polenta/binutils/unix2dos
-rwxr-xr-x  1 root root 13388 Sep 22  2003 ./cozze-polenta/binutils/unix2dos

mentre
_________________
~~ Per amore della rosa si sopportano le spine... ~~
Back to top
View user's profile Send private message
makoomba
Bodhisattva
Bodhisattva


Joined: 03 Jun 2004
Posts: 1856

PostPosted: Thu Nov 10, 2005 4:39 pm    Post subject: Reply with quote

togli quel
Code:
2>/dev/null

esegui lo script e posta l'errore
Back to top
View user's profile Send private message
Drospy
n00b
n00b


Joined: 29 Aug 2003
Posts: 42
Location: Cosenza, Italy

PostPosted: Thu Nov 10, 2005 4:40 pm    Post subject: Reply with quote

Puoi postare la schermata dell'errore.

Ma Il comando viene lanciato da linea di comando oppure da uno script.


Drospy
Back to top
View user's profile Send private message
flocchini
Veteran
Veteran


Joined: 17 May 2003
Posts: 1124
Location: Milano, Italy

PostPosted: Thu Nov 10, 2005 4:45 pm    Post subject: Reply with quote

il comando viene lanciato da uno script...

e l'errore e' "No such file or directory" per tutte le istruzioni lanciate dallo script che abbiano il "." iniziale
_________________
~~ Per amore della rosa si sopportano le spine... ~~


Last edited by flocchini on Thu Nov 10, 2005 4:59 pm; edited 1 time in total
Back to top
View user's profile Send private message
Drospy
n00b
n00b


Joined: 29 Aug 2003
Posts: 42
Location: Cosenza, Italy

PostPosted: Thu Nov 10, 2005 4:50 pm    Post subject: Reply with quote

Hai verificato che nello script non ci sia un qualche cambio di PATH?

Il comando viene lanciato da cron?

Puoi provare a inserire nello script il comando "pwd" prima dell'istruzione che va in errore, in modo da vedere in che path ci troviamo.
Back to top
View user's profile Send private message
flocchini
Veteran
Veteran


Joined: 17 May 2003
Posts: 1124
Location: Milano, Italy

PostPosted: Thu Nov 10, 2005 5:24 pm    Post subject: Reply with quote

c'era un cambio di path... che non so come era finito li' dentro visto che lo scipt era stato copiato pari pari da un'altra macchina... scusate, ora funziona tutto :oops:
_________________
~~ Per amore della rosa si sopportano le spine... ~~
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic    Gentoo Forums Forum Index Forum italiano (Italian) All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum