Afficher un message
Vieux 13/11/2007, 00h44   #2
Janis Papanagnou
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Re: printf and shell variable

Farid Hamjavar wrote:
> Greetings,
>
> In my script I have to process variables whose values
> (happen to be file names) contains the '%' character
>
> Since I have no control over how files are named,
> I was wondering if there is a way I can get around
> the situation which I am emulating through an example below:
>
>
>
> # export filename=Hello%20World
>
> # printf $filename
> bash: printf: `W': invalid format character


Provide a format string for printf...

$ filename="Hello%20World"
$ printf "%s\n" "$filename"'
Hello%20World


Janis

>
>
>
>
> Thanks,
> Farid
>
>
>

  Réponse avec citation
 
Page generated in 0,04568 seconds with 9 queries