能否用空壳脚本回响一下 正在运行的指令?
(没有将 - X 放在牛排中打开调试模式。 这不是调试进程的一部分 )
感谢 谢谢
[编辑:更多细节]
假设我有这样的剧本:
#! /bin/sh
clear
cd ~/home/
我如何将执行的两个命令( cd
和 clear
)打印到控制台?
能否用空壳脚本回响一下 正在运行的指令?
(没有将 - X 放在牛排中打开调试模式。 这不是调试进程的一部分 )
感谢 谢谢
[编辑:更多细节]
假设我有这样的剧本:
#! /bin/sh
clear
cd ~/home/
我如何将执行的两个命令( cd
和 clear
)打印到控制台?
在我版本的 /bin/sh
(Debian Almquist Shell, show) 上,除了 -x
之外没有其他方法来得到这种行为。回声命令也是 < code>-x 的 only 效果,所以我认为没有理由不使用它。
echo $0
这将回溯命令行中的第一个单词。 如果您指定一个相对路径, 如“ / bin/ test ”, 它将显示整个路径, 您可能想要 :
echo $(basename $0)
那只会反响"测试" 而不是"/bin/测试"
脚本通常在错误信息中使用0美元,而不是硬编码名称,因为程序可以从符号链接中重新命名或调用。
I need to create a simple fixed width text file in KornShell (ksh). My current attempt using printf to pad the string isn t working out very well. What s the shortest, cleanest way to create a fixed ...
how to use the find command to find files/directories which are not matching the pattern. for eg: find <some options > -name "dontfile.txt" should give me output of all the find whose file ...
I need to put the contents of all *.as files in some specified folder into one big file. How can I do it in Linux shell?
How can I check the file encoding in a shell script? I need to know if a file is encoded in utf-8 or iso-8859-1. Thanks
The == operator is used to compare two strings in shell script. However, I want to compare two strings ignoring case, how can it be done? Is there any standard command for this?
I like to write bash shell scripts on my iPhone, put them in an app folder with an icon, plist, etc., so they execute like apps by tapping their icon on SpringBoard. This is not interactive like ...
Whenever I start a shell in vim using :sh, it doesn t source my ~/.bashrc file. How can I get it to do this automatically?
在Windows XP中,没有一时出现指挥时,是否有办法操作一种灰色文字? 我常常需要把“善待”(工作)与“灰色”同起来,即使我的文字没有产出,......