- 论坛徽章:
- 1
|
本帖最后由 qimuzhi 于 2015-09-30 09:47 编辑
ligf@hot ~/tmp/shell/run-commands $ cat f.sh
#!/bin/bash -
#===============================================================================
#
# FILE: f.sh
#
# USAGE: ./f.sh
#
# DESCRIPTION:
#
# OPTIONS: ---
# REQUIREMENTS: ---
# BUGS: ---
# NOTES: ---
# AUTHOR: YOUR NAME (),
# ORGANIZATION:
# CREATED: 2015年09月30日 09:34
# REVISION: ---
#===============================================================================
CMD="ls && ls aaa && ls aasdf"
$CMD
ligf@hot ~/tmp/shell/run-commands $ ./f.sh
ls: cannot access &&: No such file or directory
ls: cannot access ls: No such file or directory
ls: cannot access aaa: No such file or directory
ls: cannot access &&: No such file or directory
ls: cannot access ls: No such file or directory
ls: cannot access aasdf: No such file or directory
ligf@hot ~/tmp/shell/run-commands $ ls && ls aaa && ls aasdf
f.sh
ls: cannot access aaa: No such file or directory
ligf@hot ~/tmp/shell/run-commands $
-------------------
上面的shell相信大家都看明白了吧?
这是为什么?script要如何才能实现和在terminal 直接敲命令的效果? 反之要如何? |
|