【发布时间】:2010-10-27 16:29:16
【问题描述】:
我对 Unix shell 脚本比较陌生。这是我的问题。我用过这个脚本...
isql -S$server -D$database -U$userID -P$password << EOF > $test
exec MY_STORED_PROC
go
EOF
echo $test
要生成这个结果...
Msg 257, Level 16, State 1:
Server 'MY_SERVER', Procedure 'MY_STORED_PROC':
Implicit conversion from datatype 'VARCHAR' to 'NUMERIC' is not allowed. Use
the CONVERT function to run this query.
(1 row affected)
(return status = 257)
我想提取“257”并将其粘贴到另一个变量中,以便从脚本中返回 257,而不是回显 isql 输出。我在想某种 sed 或 grep 命令可以做到这一点,但我真的不知道从哪里开始。
有什么建议吗?
【问题讨论】: