我需要在后台运行一个程序。我知道在命令在后台运行命令后使用“&”。
在以下脚本中:
#!/bin/bash
echo amt of time delay nsec
read nano
echo amt of time delay in sec
read sec
echo no.of times
read i
while [ $i -ne 0 ]
do
./nanosleep $sec $nano
./schello
i=$[i-1]
done
Run Code Online (Sandbox Code Playgroud)
我有一些从用户那里得到的数据。有没有办法可以在后台运行程序,在调用程序时,我还可以将所需的数据(如 nano、sec、i)指定为参数还是通过其他方式?
bash ×1