我想通过for循环浏览目录中的文件,但是出现这种情况。 echo: bad interpreter: No such file or directory
代码: #!/bin/bash
count=0
dir=`pwd`
echo "$dir"
FILES=`ls $dir`
for file in $FILES
do
if [ -f $file ]
then
cou
所以我有一个bash脚本调用另一个bash脚本。 第二个脚本位于不同的文件夹中。 script1.sh:
"some_other_folder/script2.sh"
# do something
script2.sh:
src=$(pwd) # THIS returns current directory of script1.sh...
# do something
在它的线s
我希望我的窗口标题栏显示我的PWD。在我.bashrc我有这个,这似乎做的伎俩为击: # If this is an xterm set the title to [email protected]:dir
case "$TERM" in
xterm*|rxvt*)
PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\[email prote
我在处理bash脚本语言时遇到了一些奇怪的问题。 这里是: PWD=${pwd}
# several commands
cd /etc/nginx/sites-enabled/
# more commands
cd $PWD
# I expect that I returning to my directory,
# but $PWD contains current dir - /e