Page 1 of 1

PostPosted: Fri Mar 02, 2007 11:24 am
by Uri
Hi, all!

I have a problem with writing shell script for freesco. I need to convert url from coded view (special symbols conerted to %XY, where XY is hexadecimal code of character) to normal view.

Question: how i can add character by hexadecimal (or decimal, or octal) code in shell variable?

PostPosted: Fri Mar 02, 2007 1:49 pm
by Slowpoke
Code: Select all
eval VAR=`echo -ne "\xff"`
This will put decimal character 255 (hex FF) in the variable VAR. Replace '\xff' with whatever hex code you want.

You can also use octal by omitting the 'x':
Code: Select all
eval VAR=`echo -ne "\40"`
This puts octal character 40 into variable VAR.


HTH

PostPosted: Mon Mar 05, 2007 10:13 am
by Uri
But freesco don't contains echo.
And internal ash echo don't supports -e option.

PostPosted: Fri Mar 09, 2007 6:17 am
by Uri
Added the "echo" binary so it now supports the -e flag and supports all of the normal inline commands.

This is from release notes from new (0.3.7) version of freesco.
Thanks!

PostPosted: Fri Mar 09, 2007 10:01 pm
by Lightning
Hehe, you should know that Slowpoke has been testing 037 for some time and probably forgot the echo binary is a new feature. :rolleyes:

PostPosted: Fri Mar 09, 2007 10:48 pm
by Slowpoke
:blink: Oops...

:D Good thing 0.3.7 is released now, huh?!! :happy:

Actually, the new echo will only do octal - I just checked & tried to do hex, but it didn't work... (Unless I was trying wrong!)

PostPosted: Sat Mar 10, 2007 1:07 am
by Lightning
Added the "echo" binary so it now supports the -e flag and supports all of the normal inline commands.

This statement may be a bit more than reality and it probably should have been
Added the "echo" binary so it now supports the -e flag and supports most/some of the normal inline commands.