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