|
Posted by dbee on 10/22/23 11:40
Thanks julien,
1) php cli only accepts single quotes I'm afraid. I am aware of the
difference between single and double quotes though.
2) ya, I should have included echo there. I have tried this equation
numerous ways and have had absolutely no luck. I think the problem is
getting php to interpret a bash value.
But I can't even seem to get the read function to work here...
Thanks anyway though,
Julien CROUZET wrote:
> Il se trouve que dbee a formulé :
> > Has anyone any idea why this doesn't work ?
> >
> > while read file ; do php -r 'urlencode($file);' ; done > file
> >
> > I've also tried
> >
> > cat file | php -r 'urlencode($0);' > file
> >
> > no luck there either ??
>
> 1°) This should give you a trick :
>
> $> while read file ; do echo '$file'; done
> test
> $file
>
> $> while read file ; do echo "$file"; done
> test
> test
>
> $variables are not interpreted in a single quote context, it does
> in a DOUBLE quotes one (like in PHP).
>
>
> 2°) urlencode($file) returns a string, it does not output anything,
> echo does.
> => echo urlencode($file);
>
>
>
> Still no luck ?
>
> --
> Julien CROUZET - DSI Theoconcept
> julien.crouzet@/enlever ca\theoconcept.com
> http://www.theoconcept.com
Navigation:
[Reply to this message]
|