There seems to be a problem with printf, it cannot translate all hex codes
properly.
Example;
$ STR="\x2Fusr\x2Flocal\x2Fprem\x2Fcollate\x2Fjuly.1"
$ printf "$STR\n"
/usr/local/prem�ollate/july.1

When it should be;
/usr/local/prem/collate/july.1

Notice the slash after the word prem, it has decided to delete the slash and
replace
the 'c' with a weird char.

Another example.
$ STR2="1990c\x261"
$ printf "$STR2\n"
1990ca
When it should be;
1990c&1

This was tested on RH5.2 & RH6.1

I take it I am using printf correctly, if not tell me how ??
Feedback appreciated
Regards,
David Tansley.
________________________________________________________________________

 CONFIDENTIALITY This e-mail and any attachments are confidential and may
 also be privileged. If you are not the intended recipient(s) please note
 that any distribution, copying or use of this communication or the
 information in it is strictly prohibited.If you are not the named
 recipient(s), please notify the sender immediately and do not disclose
 the contents to another person, use it for any purpose, or store or
 copy the information in any medium.


> ************

Reply via email to