The UNIX and Linux Forums  
Ciao e benvenuto da parte degli Stati Uniti al UNIX e Linux Forum! Grazie per la visita ed unirsi alla nostra Comunità Globale.

Go Back   UNIX e Linux Forum > Inizio Forum > UNIX for Dummies Domande & Risposte
.
google unix.com



UNIX for Dummies Domande & Risposte Se non sei sicuro dove pubblicare un UNIX o Linux domanda, posta da qui. Tutti i neofiti di Linux e UNIX benvenuto!

Più di UNIX e Linux Forum Argomenti potreste trovare utili
Filo Thread Starter Forum Risposte Ultimo Post
l'elenco dei file, ma esclude i file nella sottodirectory shyjuezy UNIX for Dummies Domande & Risposte 8 10-15-2008 01:42 PM
Come copiare file specificati da un elenco di file da una dir a dir B pmeesara Shell scripting e di programmazione 3 09-29-2008 03:40 PM
Come un elenco di file *. classe a parte alcuni file in cartella itsjoy2u Shell scripting e di programmazione 3 09-04-2008 10:28 AM
scp elenco dei file nmahendran Shell scripting e di programmazione 1 09-03-2008 08:09 AM
contando un elenco di stringhe in un elenco di file txt Pep Puigvert UNIX for Dummies Domande & Risposte 4 08-15-2008 03:55 PM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Cerca in questo Thread Rate Thread Modalità di visualizzazione
  #1 (permalink)  
Old 10-24-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Iscriviti Data: dicembre 2007
Location: Home di 17-volte campione del mondo Boston Celtics
Interventi: 1.311
Cool Se questo lavoro per te?

Codice:
> ls -l
total 16
drwxrwx---  2 xxx dp  512 Oct 24 08:56 ./
drwxrwx--- 99 xxx dp 3072 Oct 24 08:48 ../
-rw-rw----  1 xxx dp    0 Oct 24 08:53 LG_JG_CLIENT_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:56 LG_JG_CLIENT_200810241142_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:55 LG_JG_CLIENT_baddata.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LG_JG_CUSTOMER_20081024114245.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LG_JG_CUSTOMER_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LM_CM_CUSTOMER_20081024114245_2.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114245_2.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114269_3.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LM_JG_CUSTOMER_20081024114245_1.txt
> ls -l | grep "[A-Z]*_[A-Z]*_[A-Z]*_[0-9]\{14\}*_[0-9]*.txt"
-rw-rw----  1 xxx dp    0 Oct 24 08:53 LG_JG_CLIENT_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LG_JG_CUSTOMER_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LM_CM_CUSTOMER_20081024114245_2.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114245_1.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114245_2.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:48 LM_CM_TELEPHONE_20081024114269_3.txt
-rw-rw----  1 xxx dp    0 Oct 24 08:49 LM_JG_CUSTOMER_20081024114245_1.txt
>
  #2 (permalink)  
Old 10-24-2008
Leo_NN Leo_NN is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posti: 34
(print $. sh.version)
ksh: $ (.) sh.version: 0403-011 La sostituzione specificato non è valido per questo comando.

così come per ottenere la vera versione?
  #3 (permalink)  
Old 10-24-2008
radoulov's Avatar
radoulov radoulov is offline Forum Staff  
addict
  
 

Iscriviti Data: gennaio 2007
Ubicazione: Варна, България / Milano, Italia
Interventi: 2.847
Citazione:
Originalmente inviato da Leo_NN View Post
(print $. sh.version)
ksh: $ (.) sh.version: 0403-011 La sostituzione specificato non è valido per questo comando.

così come per ottenere la vera versione?
Puoi provare a:

Codice:
print $KSH_VERSION
Se non ricevete la produzione, si sono ksh88.
Se si insiste per conoscere l'esatto rilascio di ksh88

set-o VI (o altri) -> Esc (per entrare in modalità comando) -> Ctrl + V:

Codice:
$ set -o vi
$ Version M-11/16/88i
  #4 (permalink)  
Old 10-24-2008
joeyg's Avatar
joeyg joeyg is offline Forum Staff  
modérateur
  
 

Iscriviti Data: dicembre 2007
Location: Home di 17-volte campione del mondo Boston Celtics
Interventi: 1.311
Wink Ecco un approccio con awk

Codice:
> ls -w1
./
../
LG_JG_CLIENT_20081024114245_1.txt
LG_JG_CLIENT_200810241142_1.txt
LG_JG_CLIENT_baddata.txt
LG_JG_CUSTOMER_20081024114245.txt
LG_JG_CUSTOMER_20081024114245_1.txt
LM_CM_CUSTOMER_20081024114245_2.txt
LM_CM_TELEPHONE_20081024114245_1.txt
LM_CM_TELEPHONE_20081024114245_2.txt
LM_CM_TELEPHONE_20081024114269_3.txt
LM_JG_CUSTOMER_20081024114245_1.txt

> ls | awk -F"_" 'NF==5 && ($3=="CLIENT" || $3=="CUSTOMER") {print $0}'
LG_JG_CLIENT_20081024114245_1.txt
LG_JG_CLIENT_200810241142_1.txt
LG_JG_CUSTOMER_20081024114245_1.txt
LM_CM_CUSTOMER_20081024114245_2.txt
LM_JG_CUSTOMER_20081024114245_1.txt

> ls | awk -F"_" 'NF==5 && ($3=="CLIENT" || $3=="CUSTOMER") && ($4>20080101000000) {print $0}'
LG_JG_CLIENT_20081024114245_1.txt
LG_JG_CUSTOMER_20081024114245_1.txt
LM_CM_CUSTOMER_20081024114245_2.txt
LM_JG_CUSTOMER_20081024114245_1.txt
Forse si può vedere / capire la logica utilizzata qui, e su di esso per espandere le vostre esigenze.
I cinque campi assicurarsi - quattro caratteri _
Vedo se campo 3 è CLIENTE o CLIENTE
Verificare che la data> 2080101 (data) 000000 (tempo)
  #5 (permalink)  
Old 10-24-2008
Leo_NN Leo_NN is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posti: 34
Ecco quello che ho ricevuto:

Citazione:
> ls-l | grep "[AZ] * _ [AZ] * _ [AZ] * _ [0-9] \ (14 \) _ * [0-9] *. txt"
> Non valido \ (\) ripetizione.
  #6 (permalink)  
Old 10-24-2008
Leo_NN Leo_NN is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posti: 34
Sì, qualcosa come questo, grazie.

1.Should essere solo "ls" invece di "ls-l"?
2.Come per verificare se "l'oggetto" è nella lista?
3. qual è la giusta sintassi per mettere in grep alcuni parametri, come
ls | grep "$ () _ VENDITORE FONTE) ($ _ [AZ] * _ [0-9] \ (14 \) _ * [0-9] *. txt"?

Vai Celti!

Ultimo a cura di Leo_NN; al 10/24/2008 12:16 PM..
  #7 (permalink)  
Old 10-24-2008
Leo_NN Leo_NN is offline
Utente Registrato
  
 

Iscriviti Data: Sep 2008
Posti: 34
Nessuna:

Citazione:
> Print $ KSH_VERSION
<Nessuna OUTPUT>
> Set-o VI
>
Così è ksh88, giusto?
Closed Thread

Segnalibri

Thread Tools Cerca in questo Thread
Cerca in questo Thread:

Ricerca Avanzata
Modalità di visualizzazione Vota questo thread
Vota questo thread:

Distacco regolamento
Tu non può post nuovo thread
Tu non può inviare una risposta
Tu non può postare allegati
Tu non può modificare i tuoi post

BB codice è Su
Smilies sono Su
[IMG] codice Su
Codice HTML è Chiuso
Trackbacks sono Su
Pingbacks sono Su
Refbacks sono Su




Tutti gli orari sono GMT -4. La data di oggi è 03:27 PM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Traduzioni Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
UNIX e Linux Forum Content Copyright © 1993-2009. Tutti i diritti Reserved.Ad di gestione da RedTyger

Contenuti pertinenti URL da vBSEO 3.2.0