Mailing List archive

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

[vdr] Re: OT: Shell script



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

Well,
script2 "$SRC" helps with blanks.
but ' would be the stronger quote.

It would help if you gave us the string that doesn't work...

Probably you have to search for "bad characters", for example with 
regular expressions, and escape them...







Home | Main Index | Thread Index