这是我的代码:
#!/bin/sh
sudo touch /home/test/hello.txt
sudo chmod 777 /home/test/hello.txt
sudo touch /home/test/hello1.txt
sudo chmod 777 /home/test/hello1.txt
"$(sudo du -hs /home/test/*)" >> /home/test/hello.txt
"$(sudo sort -n /home/test/hello.txt)" >> /home/test/hello1.txt
head -3 /home/test/hello1.txt
Run Code Online (Sandbox Code Playgroud)
在第7行,它给出了错误:权限被拒绝.我已经制作了两个文件chmod 777,所以我不知道它来自哪里.
谢谢你的任何建议!
linux ×1