[PLUTO-help] Shell Scripting, reindirizzamento stdOut	allinterno di una funzione
    Paolo Ornati 
    ornati a fastwebnet.it
       
    Mer  6 Giu 2007 09:12:54 CEST
    
    
  
On Tue, 5 Jun 2007 23:16:08 +0200 (CEST)
"Andrea Tasca" <tasca a cs.unibo.it> wrote:
> Lo script template include con "source" lo script di esecuzione.
> Io vorrei lanciare da shell:
>   sh templateScript.sh  funExec  'myScript.sh > stdOut'
ma non fai prima a lanciare direttamente "myScript.sh > stdOut" :) ?
Comunque:
--- templateScript.sh ---
#!/bin/bash
case "$1" in
"funExec")
	if [ ! -x "$2" ]; then
		echo "'$2' non eseguibile"
		exit 1
	fi
	if [ -z "$3" ]; then
		echo "specificare un file di output"
		exit 1
	fi
	"./$2" > "$3"	# assumo che sia nella dir corrente ;)
	;;
*)
	echo -e "Usare:\n\t$0 funExec NomeScript FileDiOutput"
	;;
esac
-- 
	Paolo Ornati
	Linux 2.6.22-rc3-cfs-v15-g2cd88798 on x86_64
    
    
More information about the pluto-help
mailing list