[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
 

Re: [PROGRAMMERING] bash-script og parametre med wildcard



On Wednesday 15 March 2006 07:44, Peter Makholm wrote:
> Det er shellen der kalder dit script der udfolder *.jpg. Du kan ikke i
> scriptet se om brugeren har kaldt scriptet med argumentet '*.jpg'
> eller om han har kaldt det med 'img001.jpg img002.jpg img003.jpg' som
> argumenter.

Jeg gættede godt på at det var noget i den retning.

> Men du kan bruge alle argumenterne ved at bruge "$@" (*med*
> dobbelt-plinger):
>
>         #!/bin/sh
>         jhead "$@"

Det virkede. Tak.
> Det kan du som sagt ikke uden at skulle have brugeren af dit script
> til at escape stjernen. Altså noget ala:
>
>   $ ./test.sh \*.jpg
>
> eller
>
>   $ ./test.sh '*.jpg'

Det var det jeg gerne ville undgå.

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
None love the bearer of bad news.
                                                           -- Sophocles


 
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] *