[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
 

bash-script og parametre med wildcard



Jeg er i gang med at skrive et bash-script, hvor jeg kalder et program (jhead) 
med en af parametrene der gives til scriptet. Mit problem er at denne 
parameter kan være af typen *.jpg, og i det tilfælde har jeg brug for at det 
rent faktisk er strengen '*.jpg' (altså uden plingerne), der bruges som 
parameter til jhead. Men det der når frem til jhead er den første fil der 
passer på *.jpg.

Hvad gør jeg forkert? Og hvordan gør jeg det rigtigt?

Et simpelt eksempel (gemt som test.sh):

	#!/bin/bash
	jhead $1

Når jeg kører det med
	$./test.sh *.jpg
får jeg kun EXIF data fra den første JPEG-fil, men jeg vil have EXIF data 
fra /alle/ JPEG-filerne.

Hvis jeg ændrer eksemplet til 

	#!/bin/bash
	jhead $1

Viser det sig, at kaldet
	$./test.sh *.jpg
Giver dette output:
	IMG_0006.jpg
Det er navnet på den første JPEG-fil, men det jeg ville have er dette output:
	*.jpg

-- 

        |\     _,,,---,,_       Greetings, Jens
 ZZZzz /,`.-'`'    -.  ;-;;,_
      |,4-  ) )-,_. ,\ (  `'-'  sslug@sslug
     '---''(_/--'  `-'\_)
----------------------------------------------------
If his IQ slips any lower, we'll have to water him twice a day.


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