Aide Linux - Liste de diffusion Ze-Linux hebergée par Hebergement - Over-Link
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [SHELL] lancement d'un script



Bonjour,

Une possibilité :

----------------------------------------------
#!/bin/sh
if  [ $# -eq 0 ]
then
 echo  -n "Donnez le parametre :"
 read param
else
 param=$1
fi
echo "Le parametre s'appelle $param"
-------------------------------------------------------

On peut donner le parametre d'office par exemple "./appro.sh blabla"

ou taper ./appro.sh et le script va demander : Donnez le parametre :

Bon courage

Jean



michael p a écrit :

Bonjour

j'ecris un script shell qui doit se lancer obligatoirement avec un parametre.

seulement je ne sais pas comment faire pour ecrire une telle obligation.

je souhaite que lorsque je lance "./appro.sh " il y ait un message qui me dise qu'il faut entrer tel ou tel parametre...

quelqu'un peut il m'aider,svp?

merci

Michael


----------------------------------
Informations, désabonnement, règles, obligations sur la liste Aide-Linux :
http://lists.ze-linux.org/howto_ml.html
Liste Herbergee par Over-Link [http://www.over-link.net]




--
---------------------------------------------------------------------------
jean.schuller@xxxxxxxxxxxxx _/ _/_/_/ _/_/_/ _/_/_/_/
_/ _/ -/ _/ _/ _/ _/ _/_/_/-/ _/_/_/ _/_/_/_/
_/ _/ -/ _/ _/
_/ _/ _/ _/_/_/ _/_/_/_/ local call: 0388106630 Institut de Recherches Subatomiques
foreign call: (33)388106630 Boîte Postale 28 local fax : 0388106234 23, Rue du Loess
foreign fax : (33)388106234 F-67037 STRASBOURG CEDEX - France
---------------------------------------------------------------------------


----------------------------------
Informations, désabonnement, règles, obligations sur la liste Aide-Linux :
http://lists.ze-linux.org/howto_ml.html
Liste Herbergee par Over-Link [http://www.over-link.net]
begin:vcard
fn:Jean SCHULLER
n:SCHULLER;Jean
org:IReS;STI
adr:;;23, rue du Loess;STRASBOURG CEDEX;;67028;France
email;internet:JEAN.SCHULLER@xxxxxxxxxxxxx
title;quoted-printable:Ing=C3=A9nieur Syst=C3=A8me
tel;work:00 33 3 88 10 66 30
tel;cell:00 33 6 88 17 63 95
url:http://jean.schuller.free.fr
version:2.1
end:vcard



Aide Linux - Liste de diffusion Ze-Linux hebergée par Hebergement - Over-Link