我试图创建一个脚本,它使测试用户具有主dir和他需要的权限,但是每次运行该脚本时,我都会得到以下错误:
/home/thomas/Scripts/CreateUser.sh: line 2: useradd: command not found
passwd: user 'password' does not exist
/home/thomas/Scripts/CreateUser.sh: line 4: mkhomedir_helper: command not found
chmod: cannot access ‘/home/Test/’: No such file o
我正在尝试使用以下脚本,该脚本旨在修复服务器上所有cPanel用户的文件权限。脚本在第32行上返回一个错误。有人能告诉我我在那里做错了什么吗?
#!/bin/bash
# Script to fix permissions of accounts
if [ "$#" -lt "1" ];then
echo "Must specify user"
exit;
fi
USER=$@
for user in $USER
do
HOMEDIR=$(egrep "^${user}:" /etc/passwd | cut
我试图从它正在构建的包信息中执行一个源命令,但是当我试图安装它时,我得到了以下错误。
sh: 1: source: not found
ERROR: package_name/7.0@repo/stable: Error in package_info() method, line 23
self.run("source "+self.package_folder+"/pkgsdp-env.sh")
ConanException: Error 32512 while executing source /home/tusharecmc/.conan
result=$(grep -r "find this string" / | 2> /dev/null) #don't care about permission denied errors, so ditch them.
#regex=':(.+)' #matches after the filename (ie. ':String to match')
for line in $result
do
#need to preform regex on result
echo "line = $line.