[an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive] (none) [an error occurred while processing this directive] [an error occurred while processing this directive] [an error occurred while processing this directive][an error occurred while processing this directive]
 
[an error occurred while processing this directive] [an error occurred while processing this directive]
Skåne Sjælland Linux User Group - http://www.sslug.dk Home   Subscribe   Mail Archive   Forum   Calendar   Search
MhonArc Date: [Date Prev] [Date Index] [Date Next]   Thread: [Date Prev] [Thread Index] [Date Next]   MhonArc
 

'Alle parametre undtagen en' i et bash-script



Nu har jeg så fået det med *.jpg til at virke, og jeg har fået det til at 
virke, at jeg skal generere en streng ud fra en fil-dato.

Nu mangler jeg bare én ting, for at det hele går op i en højere enhed. Jeg vil 
gerne lade min bruger give en parameter, der er den streng der skal bruges 
til (C)-beskeden, og så f.eks. angive *.jpg. Som her:

	mitscript "En tekst" *.jpg

Men for at få *.jpg til at virke, så skal jeg bruge $@, som jo giver 'alle 
parametre'. Hvordan undgår jeg at "En streng" bliver taget med som et 
filnavn?

Lige nu tror jeg bare jeg skriver programmet om i C, men jeg ville lige høre 
om det kan lade sig gøre i et bash-script. Hvis man ikke spørger, så lærer 
man jo ikke noget.  :-)

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
If at first you don't suceed, destroy all evidence that you tried.


 
Home   Subscribe   Mail Archive   Index   Calendar   Search

 
 
Questions about the web-pages to <www_admin>. Last modified 2006-04-01, 02:01 CEST [an error occurred while processing this directive]
This page is maintained by [an error occurred while processing this directive]MHonArc [an error occurred while processing this directive] # [an error occurred while processing this directive] *