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. > Didattica > Corsi N - Z > Sistemi operativi I > [help] comando grep
  Last Thread   Next Thread
Author
Thread    Expand all | Contract all    Post New Thread    Post A Reply
Collapse
tandrea85
.precettore.

User info:
Registered: Sep 2004
Posts: 95 (0.01 al dì)
Location:
Corso: informatica
Anno: 1
Time Online: 18:21:48 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged
[help] comando grep

voglio usare il comando grep per verificare un pattern e se lo uso in questo modo funziona
command | grep 'ciao$'
(cerca ciao alla fine dell'output generato da command)

ma quello che voglio fare è ke ciao sia messo in una variabile, ma in questi modi non me la valuta
VAR=ciao
command | grep '$VAR$'
o
command | grep '($VAR)$'

qualcuno mi può illuminare? grazie

06-06-2006 11:05
Click Here to See the Profile for tandrea85 Click here to Send tandrea85 a Private Message Find more posts by tandrea85 Add tandrea85 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.68 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Non ho capito molto bene il problema ... :pensa:

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

06-06-2006 11:22
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
tandrea85
.precettore.

User info:
Registered: Sep 2004
Posts: 95 (0.01 al dì)
Location:
Corso: informatica
Anno: 1
Time Online: 18:21:48 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

te lo faccio piu semplice allora

grep 'pattern' nomefile

questa è la sintassi base.. scrivendolo per es cosi funziona

grep 'ciao' nome.txt

ma io lo voglio cosi
VAR=ciao
grep '$VAR' nome.txt

nell'ultimo caso credo che $VAR me lo interpreta come il pattern $VAR e non 'ciao' come vorrei io

06-06-2006 11:34
Click Here to See the Profile for tandrea85 Click here to Send tandrea85 a Private Message Find more posts by tandrea85 Add tandrea85 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.68 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ah ok.
Vuoi fare uno script in cui il pattern da cercare sia variabile ...

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

06-06-2006 12: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
tandrea85
.precettore.

User info:
Registered: Sep 2004
Posts: 95 (0.01 al dì)
Location:
Corso: informatica
Anno: 1
Time Online: 18:21:48 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Alf
Ah ok.
Vuoi fare uno script in cui il pattern da cercare sia variabile ...

ecco non mi venivano quelle parole :D

06-06-2006 12:21
Click Here to See the Profile for tandrea85 Click here to Send tandrea85 a Private Message Find more posts by tandrea85 Add tandrea85 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.68 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Mhhh controlla i pm :D

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

06-06-2006 12:36
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
tandrea85
.precettore.

User info:
Registered: Sep 2004
Posts: 95 (0.01 al dì)
Location:
Corso: informatica
Anno: 1
Time Online: 18:21:48 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Originally posted by Alf
Mhhh controlla i pm :D

scrivi pure qua cosi forse puo essere utile anke ad altri

cmq quello ke mi hai detto con gli apici inversi

VAR=ciao
grep `echo $VAR` nome.txt

non viene accettato come parametro dalla grep

06-06-2006 13:02
Click Here to See the Profile for tandrea85 Click here to Send tandrea85 a Private Message Find more posts by tandrea85 Add tandrea85 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.68 al dì)
Location: Mediolanum
Corso: Informatica
Anno: FINITOOOO!
Time Online: 155 Days, 9:46:05: [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

Ufff mhhh e che non posso controllare ;)

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

06-06-2006 13:03
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
tandrea85
.precettore.

User info:
Registered: Sep 2004
Posts: 95 (0.01 al dì)
Location:
Corso: informatica
Anno: 1
Time Online: 18:21:48 [...]
Status: Offline

Post actions:

Edit | Report | IP: Logged

risolto, la soluzione era questa

VAR=ciao
command | grep $VAR'$'

06-06-2006 14:14
Click Here to See the Profile for tandrea85 Click here to Send tandrea85 a Private Message Find more posts by tandrea85 Add tandrea85 to your buddy list Printer Friendly version Email this Article to a friend Reply w/Quote
All times are GMT. The time now is 04:34.    Post New Thread    Post A Reply
  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.112 seconds (69.01% PHP - 30.99% MySQL) con 28 query.