linux - 在 Linux 中为同一行合并两个命令

标签 linux bash ubuntu-16.04

我需要从终端在同一行中执行两个命令。但它只执行了第一个命令。

./build.py || cd /ns-3.20

该命令仅构建有效,不会导航到下一个目录。

我哪里错了?

最佳答案

|改为;:

./build.py; cd /ns-3.20

关于linux - 在 Linux 中为同一行合并两个命令,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48498712/

相关文章:

linux - Linux Bash 有 do-while 循环吗?

bash - 向标准输出添加空格

bash - 使用嵌套的 for 循环 bash

linux - 我们使用 openstack keypair 命令到 vm 时的路径是什么

linux - linux中删除和强制删除的区别

linux - bash 生成没有特殊字符的安全密码

linux - linux下使用minicom进行串行usb通信

linux - 尝试我的第一个 BASH 脚本,总是遇到意外的文件结尾

linux - 在 Rundeck 作业中从 root 切换用户(无法创建 session : Already running in a session)

python - 属性错误 : module 'mysql' has no attribute 'connector'