Hi:
I’ve run across a strange problem that I’ve tracked down to
Modules when
using ssh. Example:
bash-3.2$ foo=`ssh tewks-cc1 date '+%Y%m%d%H%M%S'`
bash-3.2$ echo $foo
20090924073725
bash-3.2$ echo "$foo" | wc
1 1 69
Note that “$foo” thinks there are 69 charcters in the
string??? Going a bit further:
bash-3.2$ bar=`ssh cc1 date '+%Y%m%d%H%M%S'`
bash-3.2$ printf "<%s>\n" "$bar" |
cat -v
<^[]2;cc1:/home/tlynch^G^[]1;cc1:/home/tlynch^G20090924100032>
This is placing my prompt into the “$bar” variable. Now for
full disclosure I use
“tcsh” as my shell and write scripts in “bash”, but the same
thing happens
in tcsh:
% set foo = `ssh hwlinux40 date '+%Y%m%d%H%M%S'`
tlynch@hwlinux:/home/tlynch[109]% echo $foo
20090924110420
tlynch@hwlinux:/home/tlynch[110]% echo $foo | wc
1 1 69
When I comment out the Modules portion in my .cshrc this
works fine. It also works fine
just on the command line with Modules:
% set foo = `date '+%Y%m%d%H%M%S'`
tlynch@hwlinux:/home/tlynch[112]% echo $foo
20090924110627
tlynch@hwlinux:/home/tlynch[113]% echo $foo | wc
1 1 15
but when using “ssh” (or “rsh”) my prompt gets placed into
the variable. Any ideas what is
going wrong here?
Thanks
Tom
Tom Lynch
HW Tools Engineer | Hardware Tools
Avid
1925 Andover St. - B2
Tewksbury, MA 01876
United States
tom.lynch@avid.com
t 978-640-5059
We're Avid. Learn more at www.avid.com