May 8, 201016 yr When I run this it returns "redwhe" as expected. s=`echo "[redwhe]" | grep '\[redwhe\]'`;echo $s When I run this in a telnet window it returns only the letter "t". Why? s=`echo "[redwhte]" | grep '\[redwhte\]'`;echo $s
May 8, 201016 yr When I run this it returns "redwhe" as expected. s=`echo "[redwhe]" | grep '\[redwhe\]'`;echo $s When I run this in a telnet window it returns only the letter "t". Why? s=`echo "[redwhte]" | grep '\[redwhte\]'`;echo $s works for me... root@Tower:~# s=`echo "[redwhte]" | grep '\[redwhte\]'`;echo $s [redwhte] root@Tower:~#
May 8, 201016 yr Author Weird. Here is what I get every time. I distilled the actual code down to just this but it happens every time in a script that runs as root.
May 8, 201016 yr works for me too. I tried with secure CRT and microsoft's telnet program. EDIT: Works ok in putty too. What terminal program are you using?
May 8, 201016 yr Author How did I get so lucky? It happens inside a script that gets kicked off automatically so it isn't the telnet session doing it. Could it be the version of linux? uname -r = 2.6.32.9-unRAID
May 8, 201016 yr Weird. Here is what I get every time. I distilled the actual code down to just this but it happens every time in a script that runs as root. Try s=`echo "[redwhte]" | grep '\[redwhte\]'`;echo $s | od -c Let's see what you are actually echoing, not what your shell might be hiding from you.
May 8, 201016 yr Author Weird. Here is what I get every time. I distilled the actual code down to just this but it happens every time in a script that runs as root. Try s=`echo "[redwhte]" | grep '\[redwhte\]'`;echo $s | od -c Let's see what you are actually echoing, not what your shell might be hiding from you. See attached.
May 8, 201016 yr Author Oh, dang. Remember back a few days when someone posted this. I stuck it in my go script and forgot to take it back out. It just hit me that maybe...and yep, it messed stuff up. Gads, I'm sorry. Wow, I just learned my lesson. sed -i 's/Restore/Destroy/g' /usr/local/sbin/emhttp
May 8, 201016 yr Oh, dang. Remember back a few days when someone posted this. I stuck it in my go script and forgot to take it back out. It just hit me that maybe...and yep, it messed stuff up. Gads, I'm sorry. Wow, I just learned my lesson. sed -i 's/Restore/Destroy/g' /usr/local/sbin/emhttp I doubt it was that, but yes, something has messed up your shell.
May 8, 201016 yr Author Oh, dang. Remember back a few days when someone posted this. I stuck it in my go script and forgot to take it back out. It just hit me that maybe...and yep, it messed stuff up. Gads, I'm sorry. Wow, I just learned my lesson. sed -i 's/Restore/Destroy/g' /usr/local/sbin/emhttp I doubt it was that, but yes, something has messed up your shell. Ok, this is weird. I took that out of the go script and then tested again and I get back the whole [redwhte] string. Yet, they can't be related because I didn't run the go again. What's happening? Immediately after running your script piece with the od -c I edited the go script and then started working correctly. Edit: I rebooted and it's not happening anymore. Thanks for helping.
Archived
This topic is now archived and is closed to further replies.