I have a simple shell that print a file. The file, the printer, the user are inputs to insert. It runs: the is if i want a log file, where it doesn't write the right information. Where do i wrong?
I hope to be clear, thanks for your help
Francesca
This is the code of my shell:
LOGFILE=./stampa.log
touch stampa.log
provanuminput()
{
echo $#
# se il num di parametri introdotti e' diverso da 4
if [ $# -ne 4 ]
then
echo "Il numero di parametri introdotti non e' corretto"
# esci
exit 0;
fi
echo "Viene introdotta la richiesta di stampa"
lanciastampa()Quote:}
{
if [ $1 != "1" ]
then
echo "L'operazione richiesta non e' valida"
# esci
exit 0;
fi
echo "inviata richiesta di stampa"
echo $4
rsh 190.10.0.85 -l $4 lp -d $2 $3
./shfra2.sh >>$LOGFILE
status=$?
if [ "$status" != 0 ]
then
# echo $status >>$LOGFILE
echo "stampa non eseguita "$status >> $LOGFILE
exit $status
fi
# echo $status >>$LOGFILE
echo "stampa terminata con successo "$status >>$LOGFILE
main()Quote:}
{
provanuminput $1 $2 $3 $4
lanciastampa $1 $2 $3 $4
main $1 $2 $3 $4Quote:}