The problem I'm having: The translate utility seems to only replace the '\t' with the first character in the second string.

So let’s say I give the script this input:{tab}hello

I want hello

I get hello

Other things I have tried

Code:

#!/bin/shinput=`echo $* | tr '\t' '\ '`echo "$input"

Code:

#!/bin/shinput=`echo $* | tr '\t' '\ \ \ '`echo "$input"

Code:

#!/bin/shinput=`echo $* | tr '\t' '" "'`echo "$input"

Nothing has worked so far, rather frustrating.

If you have read this far, you will most likely continue reading this, please do.Thank you for taking your time to read this. Although you may find my script to be amateur, I have just started in the world of unix/linux.If you have a solutionan explanation of why my script didn't work and an explanation of how the fixed versionworks would be most helpful. I hope I didn't post in the wrong thread, my apologies. thanks again.Adam

Who is online

Users browsing this forum: No registered users and 1 guest

You cannot post new topics in this forumYou cannot reply to topics in this forumYou cannot edit your posts in this forumYou cannot delete your posts in this forumYou cannot post attachments in this forum