Mailing List archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[vdr] Re: OT: Shell script



Try this:

script1.sh:

#!/bin/sh
# Variable $SRC has the complete string (including) "bad" characters
SRC="foo bar yugga yugga"
echo "${SRC}" >out1.txt
script2 "${SRC}"

script2.sh:

#!/bin/sh
# this is script2 !
echo "${1}" > out2.txt

player:~ # diff out1.txt out2.txt
player:~ #

Works perfect here...


Martin Hoffmann wrote:
> Hi,
> 
> does anyone know how to call a shell script from another and give a filename 
> as paramterer just _exactly_ as it is ? Without bash interpreting anything ?
> 
> I have this problem, that certain filenames (from VDR) are changed when giving 
> them as argument to a second script ! Especially ' characters, which are also 
> ommited when using echo, are interpreted, or dropped it seems !
> 
> Example:
> #!/bin/sh
> # Variable $SRC has the complete string (including) "bad" characters
> echo $SRC >out1.txt
> script2 $SRC
> 
> #!/bin/sh
> # this is script2 !
> echo $1 > out2.txt
> 
> out1.txt and out2.txt differ ! The second one has the characters stripped off 
> already :-(
> 
> Also script2 "$SRC" did not change anything :-(
> 
> btw: echo $SRC (to the console) gives same output as out2.txt is ! But 
> out1.txt is different !
> 
> Anyone ?
> 
> Martin
> 
> 


-- 
with best regards
--
Karsten Mueller
Softwaredevelopment / Keyaccount Manager
RATIO Entwicklungen GmbH
Admiralitaetstr. 59
20459 Hamburg
Email: mailto:kmu@ratio.de






Home | Main Index | Thread Index