Dsy Network www | forum | my | didattica | howto | wiki | el goog | stats | blog | dona | rappresentanti
Homepage
 Register   Calendar   Members  Faq   Search  Logout 
.dsy:it. : Powered by vBulletin version 2.3.1 .dsy:it. > Community > Tech > [Misteri] -e si nasconde
Pages (5): [1] 2 3 4 5 »   Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
lallyblue
.grande:maestro.

User info:
Registered: Sep 2002
Posts: 2868 (0.34 al dì)
Location: un puntino nello spazio infinito
Corso: Informatica
Anno: ZERO!
Time Online: 29 Days, 9:48:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[Misteri] -e si nasconde

Ciao!
questa di oggi proprio mi lascia senza parole... spero davvero che qcuno mi chiarisca il mistero... :pensa:

se assegno ad una variabile pippo il valore '-e' non c'è santo che tenga, ma echo non la visualizza... :shock:
perché?

mi spiego meglio:

code:
[root@lab0204 root]# pippo=-q [root@lab0204 root]# echo $pippo -q [root@lab0204 root]# pippo=-e [root@lab0204 root]# echo $pippo [root@lab0204 root]#


ho provato anche con apici, virgolette, lo slash davanti al meno...
ma niente, non stampa nulla...
come mai? come posso risolvere?
grazie in anticipo!

__________________
*** Proposta di legge di iniziativa popolare: "8x1000 ALLA RICERCA"
Informati e firma la petizione! E' nel tuo interesse! ;)

*** Browse my dA gallery ! ;)
***In medio stat virtus

Last edited by lallyblue on 26-08-2005 at 13:59

26-08-2005 13:53
Click Here to See the Profile for lallyblue Click Here to See the Blog of lallyblue Click here to Send lallyblue a Private Message Visit lallyblue's homepage! Find more posts by lallyblue Add lallyblue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Cambia shell
usi la bash ?

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 13:58
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lallyblue
.grande:maestro.

User info:
Registered: Sep 2002
Posts: 2868 (0.34 al dì)
Location: un puntino nello spazio infinito
Corso: Informatica
Anno: ZERO!
Time Online: 29 Days, 9:48:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

altra cosa...
io ho bisogno di controllare se un'opzione, passata come argomento di uno script, fa parte di un certo range di opzioni possibili.
X chiarire meglio, l'opzione può essere una tra le seguenti:
-e
-q
-ue
-uq
mi è venuto spontaneo pensare alle regexp e da quanto ho capito la sintassi dovrebbe essere qcosa del genere
/-u?[eq] /
eppure non c'è modo di passarlo come argomento di un grep
anche qui, ho provato con egrep, con grep -P, grep -e e tante altre...ma non c'è verso...
l'unica che funziona ma non come mi serve è
-u*[eq]
che però accetta anche -uuuue o -uuq
se non metto la stellina non accetta i semplici -e e -q
come diavolo faccio?!?!

tnx!!

__________________
*** Proposta di legge di iniziativa popolare: "8x1000 ALLA RICERCA"
Informati e firma la petizione! E' nel tuo interesse! ;)

*** Browse my dA gallery ! ;)
***In medio stat virtus

26-08-2005 13:58
Click Here to See the Profile for lallyblue Click Here to See the Blog of lallyblue Click here to Send lallyblue a Private Message Visit lallyblue's homepage! Find more posts by lallyblue Add lallyblue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lallyblue
.grande:maestro.

User info:
Registered: Sep 2002
Posts: 2868 (0.34 al dì)
Location: un puntino nello spazio infinito
Corso: Informatica
Anno: ZERO!
Time Online: 29 Days, 9:48:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

sì sto usando la bash
ma non capisco dove sbaglio... :roll:

__________________
*** Proposta di legge di iniziativa popolare: "8x1000 ALLA RICERCA"
Informati e firma la petizione! E' nel tuo interesse! ;)

*** Browse my dA gallery ! ;)
***In medio stat virtus

26-08-2005 13:59
Click Here to See the Profile for lallyblue Click Here to See the Blog of lallyblue Click here to Send lallyblue a Private Message Visit lallyblue's homepage! Find more posts by lallyblue Add lallyblue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by lallyblue
sì sto usando la bash
ma non capisco dove sbaglio... :roll:


Non credo sia un errore ...
Forse nella bash -e e' qualcosa di particolare .. pero non so ...


Per l'altra domanda ...
Non puoi usare case ?

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:04
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
jdhoring
Ma saggio de che?

User info:
Registered: May 2003
Posts: 2867 (0.34 al dì)
Location: Milano
Corso: Informatica triennale
Anno: Giurassico
Time Online: 27 Days, 17:36:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Hai provato

pippo=\"-e\"
echo $pippo

?

__________________
Furbo è colui che è molto bravo a togliersi da quei guai in cui il saggio non si sarebbe mai cacciato

Il bravo motociclista è come un buon amante: ha equilibrio, giudizio e tempismo.

Nessuna forma d'amore ha tanto rispetto per la libertà dell'altro come l'amicizia.

26-08-2005 14:05
Click Here to See the Profile for jdhoring Click Here to See the Blog of jdhoring Click here to Send jdhoring a Private Message Find more posts by jdhoring Add jdhoring to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by jdhoring
Hai provato

pippo=\"-e\"
echo $pippo

?


ma cosi' ritornera' \"-e\" non -e

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:11
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
lallyblue
.grande:maestro.

User info:
Registered: Sep 2002
Posts: 2868 (0.34 al dì)
Location: un puntino nello spazio infinito
Corso: Informatica
Anno: ZERO!
Time Online: 29 Days, 9:48:21 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

@alf boh, mi sembrava + sensato usare le regexp visto che (in teoria) era molto + banale... se solo non facesse le bizze...

@jd: mi stampa "-e" (anche con gli apici) che purtroppo non è cmq quello che mi serve :\

ah non va nemmeno se faccio semplicemente "echo -e" :(

__________________
*** Proposta di legge di iniziativa popolare: "8x1000 ALLA RICERCA"
Informati e firma la petizione! E' nel tuo interesse! ;)

*** Browse my dA gallery ! ;)
***In medio stat virtus

26-08-2005 14:12
Click Here to See the Profile for lallyblue Click Here to See the Blog of lallyblue Click here to Send lallyblue a Private Message Visit lallyblue's homepage! Find more posts by lallyblue Add lallyblue to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by lallyblue
@alf boh, mi sembrava + sensato usare le regexp visto che (in teoria) era molto + banale... se solo non facesse le bizze...

@jd: mi stampa "-e" (anche con gli apici) che purtroppo non è cmq quello che mi serve :\

ah non va nemmeno se faccio semplicemente "echo -e" :(


Ehmm lally credo sia un opzione del echo .. ma non dirti quale .. :)

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:16
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Alf
Ehmm lally credo sia un opzione del echo .. ma non dirti quale .. :)


Ah ecco .. sul man in linea non lo dava.



Echo the STRING(s) to standard output.

-n do not output the trailing newline

-e enable interpretation of the backslash-escaped characters listed
below

-E disable interpretation of those sequences in STRINGs



Percio di -e -E -n non puoi fare l'echo

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:18
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
jdhoring
Ma saggio de che?

User info:
Registered: May 2003
Posts: 2867 (0.34 al dì)
Location: Milano
Corso: Informatica triennale
Anno: Giurassico
Time Online: 27 Days, 17:36:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

ma no... echo non ci deve nemmeno arrivare a valutare il -e

provato con

echo "-e"
echo \-e

?

__________________
Furbo è colui che è molto bravo a togliersi da quei guai in cui il saggio non si sarebbe mai cacciato

Il bravo motociclista è come un buon amante: ha equilibrio, giudizio e tempismo.

Nessuna forma d'amore ha tanto rispetto per la libertà dell'altro come l'amicizia.

26-08-2005 14:20
Click Here to See the Profile for jdhoring Click Here to See the Blog of jdhoring Click here to Send jdhoring a Private Message Find more posts by jdhoring Add jdhoring to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
ak47
.illuminato.

User info:
Registered: Nov 2002
Posts: 178 (0.02 al dì)
Location:
Corso: I.C.T.
Anno: thesis
Time Online: 9 Days, 0:44:31 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

dunque, il motivo per cui non visulizza il -e non è perche non la memorizza nella variabile $a (ad esempio), ma perche applica il flag -e al comando echo... quindi se quel -e ($a) ti serve in uno script di shell puoi usarlo tranquillamente.....
la RE che soddisfa la tua richiesta è [-e|-q|-ue|-uq]

Saluti

__________________
"The POP3 server service depends on the SMTP server service, which failed to start because of the following error: The operation completed successfully." (Windows NT Server v3.51)

26-08-2005 14:21
Click Here to See the Profile for ak47 Click here to Send ak47 a Private Message Find more posts by ak47 Add ak47 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
jdhoring
Ma saggio de che?

User info:
Registered: May 2003
Posts: 2867 (0.34 al dì)
Location: Milano
Corso: Informatica triennale
Anno: Giurassico
Time Online: 27 Days, 17:36:29 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Su Solaris 9, Korn shell

$ pippo="-e"
$ echo $pippo
-e

__________________
Furbo è colui che è molto bravo a togliersi da quei guai in cui il saggio non si sarebbe mai cacciato

Il bravo motociclista è come un buon amante: ha equilibrio, giudizio e tempismo.

Nessuna forma d'amore ha tanto rispetto per la libertà dell'altro come l'amicizia.

26-08-2005 14:21
Click Here to See the Profile for jdhoring Click Here to See the Blog of jdhoring Click here to Send jdhoring a Private Message Find more posts by jdhoring Add jdhoring to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by jdhoring
ma no... echo non ci deve nemmeno arrivare a valutare il -e

provato con

echo "-e"
echo \-e

?


Con la bash ??
Il problema lo da solo con la bash JD!

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:24
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
Collapse
Alf
°o.mini sayan.o°

User info:
Registered: Jun 2003
Posts: 5381 (0.65 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by ak47
dunque, il motivo per cui non visulizza il -e non è perche non la memorizza nella variabile $a (ad esempio), ma perche applica il flag -e al comando echo... quindi se quel -e ($a) ti serve in uno script di shell puoi usarlo tranquillamente.....
la RE che soddisfa la tua richiesta è [-e|-q|-ue|-uq]

Saluti


Esatto come dicevo nello stralcio dell'help :)

Boh io avrei fatto cosi'

case "$1" in

"-e"|"-q"|"-u"|"-uq")
command
command

;;
esac


:)

__________________
(\ /)
( . .)
c('')('') This is Bunny!
Help her succeed in world domination by copy and pasting her in
your signature.

26-08-2005 14:25
Click Here to See the Profile for Alf Click Here to See the Blog of Alf Click here to Send Alf a Private Message Find more posts by Alf Add Alf to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 20:48.    Post New Thread    Post A Reply
Pages (5): [1] 2 3 4 5 »   Last Thread   Next Thread
Show Printable Version | Email this Page | Subscribe to this Thread | Add to Bookmarks

Forum Jump:
Rate This Thread:

Forum Rules:
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts
HTML code is OFF
vB code is ON
Smilies are ON
[IMG] code is ON
 

Powered by: vBulletin v2.3.1 - Copyright ©2000 - 2002, Jelsoft Enterprises Limited
Mantained by dsy crew (email) | Collabora con noi | Segnalaci un bug | Archive | Regolamento | Licenze | Thanks | Syndacate
Pagina generata in 0.086 seconds (53.12% PHP - 46.88% MySQL) con 25 query.