日期:2014-05-16  浏览次数:20815 次

cshell脚本中read的问题
请教大家个问题,我使用的环境是IBM服务器,操作系统AIX,写了一个c shell脚本,但是老是出错,哪位高人帮看看,脚本如下(文件名111):
#!/bin/csh
echo abc
read ttt
echo $ttt

执行结果如下:
%csh -xv 111

echo abc^M 
echo abc^M
abc
read ttt^M 
read ttt^M
/usr/bin/read[53]: ttt^M: is not an identifier
echo $ttt^M 
ttt: Undefined variable.

------解决方案--------------------
网上说csh没有read 功能
------解决方案--------------------
在csh里,替代read的用
set aaa=$<
echo $aaa

http://www.lslnet.com/linux/dosc1/20/linux-193251.htm