Issue with command tr.

Hi,

I am using tr command like below:

cat file_name | tr -c "[:print:][:cntrl:]" "[0*]" > output_file

When i run my script from command mode, it is working fine. I scheduled my job in autosys. When the job runs at specified I am getting below Error:

tr: when translating with complemented character classes,string2 must map all characters in the domain to one.

Any help will be greatly appreciated.
Note: in first braces the word is : followed by print (": print).

Thanks,
KP

To avoid stuff getting converted into symbols, use code tags.

You have a useless use of cat in there.

Is this GNU tr? I wonder if this is character set related. what's your environment?

Try:

#!/bin/bash
LANG=en_US ; export LANG

at the top of your script.

Thanks for your reply.
I am using GNU/Linux.

Linux 2.6.9-78.0.17.ELsmp #1 SMP Thu Mar 5 04:58:34 EST 2009 x86_64 x86_64 x86_64 GNU/Linux

Thanks

@Corona688
What is your replacement line which works with Autosys and does not use cat?

Back on topic, suggest O/P creates a script with an appropriate shebang line because C.A. Autosys uses "exec" to run commands and many aspects of the original command line upset Autosys (pipe, redirect and wildcard).

Please can further suggestions be confined to those who have current experience of C.A. Autosys. I'm very rusty but have at least used this product.

If it supports pipes, I suspect it supports redirection too. As suggested in my link you could try command < filename instead of cat filename | command.