小编co-*_*ker的帖子

Linux:在脚本中运行二进制文件

我想通过脚本运行程序.通常我输入./programshell并启动程序.

我的脚本看起来像这样:

#!/bin/sh
cd  /home/user/path_to_the_program/
sh program
Run Code Online (Sandbox Code Playgroud)

它失败了,我认为最后一行出了问题......

我知道这是幼稚的问题,但是很多!

linux shell cd sh

9
推荐指数
3
解决办法
4万
查看次数

如何在bash脚本中循环?

我在Linux下的bash脚本中有以下行:

...
mkdir max15
mkdir max14
mkdir max13
mkdir max12
mkdir max11
mkdir max10
...
Run Code Online (Sandbox Code Playgroud)

如何将它们放在循环中的语法,以便我不必写数字(15,14 ..)?

bash

5
推荐指数
4
解决办法
8835
查看次数

C++:错误:期望的primary-expression

void add(int register, int& acc)
{
    acc += register;
}
Run Code Online (Sandbox Code Playgroud)

main.cpp:124:错误:'register'之前的预期primary-expression

那边有错吗?

c++ function

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

标签 统计

bash ×1

c++ ×1

cd ×1

function ×1

linux ×1

sh ×1

shell ×1