View previous topic :: View next topic |
Author |
Message |
berus Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 28 Dec 2003 Posts: 347 Location: Italy
|
Posted: Mon Nov 07, 2005 10:47 am Post subject: [KSH &C.] - Passaggio variabile tramite remsh [Risolto] |
|
|
Prendiamo in esempio il seguente scrippppt.. Code: | #!/bin/ksh
HOST='uname -m' #restituisce client1
xhost +
remsh server '. .profile; DISPLAY=client1:0.0; export DISPLAY; /usr/apl/myapl' | Come posso passare la variabile $HOST al comando remoto così da avere client1 dopo DISPLAY=? Ho provato un Code: | remsh server '. .profile; DISPLAY=$HOST:0.0; export DISPLAY; /usr/apl/myapl' | ma giustamente non funziona
Grazie! ![Rolling Eyes :roll:](images/smiles/icon_rolleyes.gif)
Last edited by berus on Mon Nov 07, 2005 3:35 pm; edited 1 time in total |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gutter Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/67030318436dd16c1dd5e.jpg)
Joined: 13 Mar 2004 Posts: 7162 Location: Aarau, Aargau, Switzerland
|
Posted: Mon Nov 07, 2005 2:44 pm Post subject: |
|
|
Credo che il problema sia negli apici singoli che non permettono l'espansione delle variabili:
Hai provato così:
Code: | remsh server ". .profile; DISPLAY=$HOST:0.0; export DISPLAY; /usr/apl/myapl" |
_________________ Registered as User #281564 and Machines #163761 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
berus Guru
![Guru Guru](/images/ranks/rank_rect_3.gif)
Joined: 28 Dec 2003 Posts: 347 Location: Italy
|
Posted: Mon Nov 07, 2005 3:34 pm Post subject: |
|
|
Che stupido!!! Il problema era quello.. associato all'uname -m che non so da dove l'abbia preso.. associato agli apici inversi di HOST (gira anche su SUN).
Grazie!! |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
gutter Bodhisattva
![Bodhisattva Bodhisattva](/images/ranks/rank-bodhisattva.gif)
![](images/avatars/67030318436dd16c1dd5e.jpg)
Joined: 13 Mar 2004 Posts: 7162 Location: Aarau, Aargau, Switzerland
|
Posted: Mon Nov 07, 2005 9:31 pm Post subject: |
|
|
Figurati ![Smile :)](images/smiles/icon_smile.gif) _________________ Registered as User #281564 and Machines #163761 |
|
Back to top |
|
![](templates/gentoo/images/spacer.gif) |
|