![]() |
|
|
google unix.com
|
|||||||
| Forum | Registrati | Regole Forum | Collegamenti | Album | FAQ | Members List | Calendario | Ricerca | Today's Posts | Mark Forums Read |
| Shell scripting e di programmazione Pubblica domande su KSH, CSH, SH, Bash, Perl, PHP, sed, awk e da altri script di shell e linguaggi di scripting shell qui. |
Più di UNIX e Linux Forum Argomenti potreste trovare utili
|
||||
| Filo | Thread Starter | Forum | Risposte | Ultimo Post |
| df, grep, wild card | itik | AIX | 2 | 01-24-2008 10:41 AM |
| Wild card nel trovare perm | braindrain | Shell scripting e di programmazione | 1 | 04-12-2007 07:24 PM |
| Come faccio a passare una wild card come un argomento | EJA | UNIX for Dummies Domande & Risposte | 2 | 03-28-2007 03:03 PM |
| ls e wild card - Dovrebbe essere semplice! | GNMIKE | UNIX for Dummies Domande & Risposte | 2 | 10-13-2005 08:41 AM |
| utilizzando se con wild card modelli | ROOH | UNIX for Dummies Domande & Risposte | 1 | 05-18-2002 08:15 AM |
![]() |
|
|
LinkBack | Thread Tools | Cerca in questo Thread | Rate Thread | Modalità di visualizzazione |
|
|
|
||||
|
Trova Esistenza di file con wild card utilizzando csh
Hi All,
Vorrei sapere l'esistenza di un file con wild card utilizzando CSH. Ho usato il seguente codice, ma non sembra funzionare. Posso esperti darmi qualche consiglio? Codice:
set nonomatch
set pattern = "_xxx"
set filetype = ( *$pattern* )
if ( -e $filetype) then
echo "FILES with $pattern EXISTS"
else
echo "FILES with $pattern DOES NOT EXISTS"
endif
|
|
||||
|
Il problema è che la -E prova si aspetta solo un nome di file, in modo che se si rompe il tuo modello di partite più file. Fate la prova su un solo file, ovvero il primo elemento di $ filetype:
Codice:
if ( -e $filetype[1] ) then
echo "FILES with $pattern EXISTS"
else
echo "FILES with $pattern DOES NOT EXISTS"
endif
|
![]() |
| Segnalibri |
| Thread Tools | Cerca in questo Thread |
| Modalità di visualizzazione | Vota questo thread |
|
|