我有以下bash脚本,我想进入fakeroot环境,然后运行其他命令,然后退出,我可以运行我的笔记本电脑ubuntu终端。
$ cat test_root.sh
#!/bin/bash
set -u
set -e
fakeroot
echo "my $UID"
exit但是这个脚本不会起作用,感谢你的提示来修复它。
$ ./test_root.sh
root\#
root\# exit
exit
my 1000谢谢。
致以亲切的问候,
发布于 2020-03-31 17:26:55
来自man fakeroot的fakeroot -- command报道。
$ fakeroot sh -c 'echo "my $UID"'
my 0https://stackoverflow.com/questions/60947154
复制相似问题