相关疑难解决方法(0)

目的是什么:(冒号)GNU Bash内置?

命令的目的是什么,什么都不做,只是一个评论领导者,但实际上是一个内置的shell?

它比在每个调用中将注释插入脚本大约40%要慢,这可能会根据注释的大小而有很大差异.我能看到的唯一可能的原因是:

# poor man's delay function
for ((x=0;x<100000;++x)) ; do : ; done

# inserting comments into string of commands
command ; command ; : we need a comment in here for some reason ; command

# an alias for `true' (lazy programming)
while : ; do command ; done
Run Code Online (Sandbox Code Playgroud)

我想我真正想要的是它可能具有的历史应用.

bash shell built-in

313
推荐指数
11
解决办法
11万
查看次数

使用 shell 脚本设置环境变量 (Linux)

我是 shell 脚本新手。我编写了一个脚本来检查 ORACLE_HOME 和 ORACLE_SID 是否已设置。在其中我调用了其他脚本来设置环境变量。


第一个脚本

while [ 1 -gt 0 ]
do
    echo -e "Please enter path of oracle home directory:\c"
    read DB_HOME
            if [ -d $DB_HOME ]
            then
                    ./oracle_env.sh $DB_HOME "test1"
                    echo "ORACLE_HOME has been set successfully!"
                    status="Y"
                    break
            else
            echo "Path or directory does not exist."
            fi
done
Run Code Online (Sandbox Code Playgroud)

第二个脚本

#This script will set ORACLE_HOME and SID
export ORACLE_HOME=$1
export  ORACLE_SID=$2
Run Code Online (Sandbox Code Playgroud)

当我运行第二个脚本时

./oracle_env.sh /u01/app/oracle test
Run Code Online (Sandbox Code Playgroud)

工作正常。我的意思是,当我跑步时

echo $ORACLE_HOME
Run Code Online (Sandbox Code Playgroud)

它给出了类似的路径

/u01/app/oracle
Run Code Online (Sandbox Code Playgroud)

现在的问题是,当我从第一个脚本运行相同的脚本时,它不起作用。

请帮帮我!

linux shell

1
推荐指数
1
解决办法
1万
查看次数

标签 统计

shell ×2

bash ×1

built-in ×1

linux ×1