可执行文件 (cURL) 的输出包含 \n。如何用换行符显示这样的输出?
假设一个可执行文件的输出是tCL\n1523 memo\n
,管道到 printf 不显示换行符。
$ echo "tCL\n1523 memo\n"
tCL\n1523 memo\n
$
$ printf "tCL\n1523 memo\n"
tCL
1523 memo
$
$ echo "tCL\n1523 memo\n" | xargs -0 printf '%s'
tCL\n1523 memo\n
$
$ echo "tCL\n1523 memo\n" | awk '{ printf "%s", $0 }
tCL\n1523 memo\n
Run Code Online (Sandbox Code Playgroud) 我在 Windows 上通过 SecureCRT 在远程 Linux 上运行 Gaussian 时遇到问题。
Gaussian在运行时会生成不同的子可执行文件(“链接”)。例如,我通过运行开始高斯nohup g09 < test.in > test.out 2> test.out &
,并g09
会产卵不同link
S,从而为l301.exe
和l502.exe
在特定的情况下。
当我连接到远程 Linux 机器并使用nohup ${Path_Of_Gaussian}/g09 < jobname.in > jobname.out 2> jobname.out &
以下命令运行 Gaussian 时:
如果我通过键入exit
并按退出 shell Enter,我可以退出而 Linux 上的 Gaussian 继续运行(特定可执行文件的名称取决于特定时间)。
如果我关闭计算机电源(然后 SecureCRT 将关闭),Linux 上的 Gaussian 会被杀死并抱怨“挂断”。
如果我输入exit
并按退出Enter,然后登录,我可以关闭计算机,Linux 上的 Gaussian 继续运行。
jlliagre
的答案在这种情况下不起作用。
以一个简单的可执行文件为例,它什么都不做(即,不处理输入和输出)但休眠 10 分钟。当我运行它时nohup ${Path_Of_Executable}/executable …
rename.ul
你能建议一下在Ubuntu 22.04下如何使用吗?非常感谢 !
Welcome to Ubuntu 22.04.1 LTS (GNU/Linux 5.10.102.1-microsoft-standard-WSL2 x86_64)
* Documentation: https://help.ubuntu.com
* Management: https://landscape.canonical.com
* Support: https://ubuntu.com/advantage
/etc/update-motd.d/50-landscape-sysinfo: 17: cannot create /var/lib/landscape/landscape-sysinfo.cache: Permission denied
System information as of Thu Aug 11 14:43:22 CST 2022
System load: 0.0 Processes: 15
Usage of /: 15.8% of 250.98GB Users logged in: 0
Memory usage: 0% IPv4 address for eth0: 172.25.114.46
Swap usage: 0%
0 updates can be applied immediately.
This message is shown once a day. To disable it …
Run Code Online (Sandbox Code Playgroud)