读书人

cshell脚本中read的有关问题

发布时间: 2012-03-30 17:32:09 作者: rapoo

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

读书人网 >UNIXLINUX

热点推荐