The UNIX and Linux Forums  

Go Back   UNIX e Linux Forum > Inizio Forum > Shell scripting e di programmazione
.
google unix.com



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
Hai bisogno di aiuto in sostituzione! uLearner UNIX for Dummies Domande & Risposte 3 03-06-2008 07:21 PM
AWK sostituzione klut Shell scripting e di programmazione 4 01-15-2008 11:26 AM
ksh sostituzione solea Shell scripting e di programmazione 2 08-09-2004 06:30 AM
sed sostituzione jo_aze UNIX for Dummies Domande & Risposte 3 06-23-2002 10:32 PM
sostituzione supercbw Shell scripting e di programmazione 1 06-07-2002 04:07 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 02-07-2007
D_Redd74 D_Redd74 is offline
Utente Registrato
  
 

Iscriviti Data: febbraio 2007
Interventi: 2
Question Bad Sostituzione

Hai bisogno di aiuto ... Io sono sempre un brutto errore di sostituzione sul mio script su un server Solaris. Comunque lo script è stato provato a lavorare su server HPUX e Solaris ...


#! / usr / bin / sh
#
# Impostare il percorso del file tzupdater.jar
#
JAR \u003d / tmp / tzupdater.jar # <<<<< AGGIORNAMENTO >>>>> LINE IL PRESENTE
#
# Cancella i file di log se esistono

if [[-f / tmp / $ (0 ##*/}. all_javas]], quindi
rm-f / tmp / $ (0 ##*/}. all_javas
fi
if [[-f / tmp / $ (0 ##*/}. old_javas]], quindi
rm-f / tmp / $ (0 ##*/}. old_javas
fi
if [[-f / tmp / $ (0 ##*/}. cur_javas]], quindi
rm-f / tmp / $ (0 ##*/}. cur_javas
fi

# Trova tutti i file chiamato java sul sistema
# E salvare la lista in un registro di tutti i file java
find /-fstype nfs -prune-o-fstype autofs-prune-o nome-java-type f-print-o nome-java-l-tipo stampa | tee / tmp / $ (0 ##*/}. all_javas | \
mentre leggere JAVA; fare
exec 2> / dev / null # Ignora i messaggi di errore
$ JAVA-versione> / dev / null 2> / dev / null # Check java come risponde
if (($? \u003d\u003d 0)); poi # Se RC \u003d 0, è vaid
# Scopri la versione di Java è presente
VERSION \u003d $ ($ JAVA-version 2> & 1 | awk 'NR \u003d\u003d 1 (print substr ($ 3,4,1))')
if (($ VERSION> 3)), quindi
# Se la versione è superiore a 1,3, andare avanti e lo aggiorna
print "$ ($ JAVA-version 2> & 1 | awk 'NR \u003d\u003d 1 (print $ 3)') \ t $ JAVA">> / tmp / $ (0 ##*/}. # cur_javas Salva elenco degli attuali javascript
# Controlla se questo java è stato aggiornato o non
$ Java-jar $ JAR-t> / dev / null 2> & 1
if (($?> 0)); poi # Se non aggiornati, il suo aggiornamento
print "$ Aggiornare JAVA"
$ Java-jar $ JAR-u
else # Altrimenti, stampare un messaggio già aggiornato
print "$ JAVA già aggiornato"
fi
else cmd # Questa è una vecchia versione di Java
print "$ ($ JAVA-version 2> & 1 | awk 'NR \u003d\u003d 1 (print $ 3)') \ t $ JAVA">> / tmp / $ (0 ##*/}. # old_javas Salva elenco di vecchi javascript
fi
fi
fatto
#
  #2 (permalink)  
Old 02-07-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Ubicazione: Ashburn, Virginia
Messaggi: 9.123
Provare a cambiare
#! / usr / bin / sh
a
#! / usr / bin / ksh
  #3 (permalink)  
Old 02-07-2007
D_Redd74 D_Redd74 is offline
Utente Registrato
  
 

Iscriviti Data: febbraio 2007
Interventi: 2
Thumbs up

Grazie ... Che ha lavorato? Qualsiasi idea script lavorato in entrambi i HPUX e RHEL, ma doveva essere cambiato in Solaris?
  #4 (permalink)  
Old 02-07-2007
Perderabo's Avatar
Perderabo Perderabo is offline Forum Staff  
Unix Daemon
  
 

Join Date: Aug 2001
Ubicazione: Ashburn, Virginia
Messaggi: 9.123
Il RHEL, / usr / bin / sh è bash. Su HP-UX è "posix guscio ", basato su ksh. Su Solaris, ed è davvero sh, la vecchia shell Bourne.
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 è 06:07 AM.


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