可能重复:
How to successfully run Perl script with setuid() when used as cgi-bin?
我正在以root身份运行我的Perl脚本,并希望将这些命令作为$USER
运行
mkdir bin
cp -r /opt/gitolite .
gitolite/install -ln
gitolite setup -pk ${USER}.pub
rm ${USER}.pub
mkdir -p .gitolite/hooks/common
ln -s /opt/pre-receive .gitolite/hooks/common/
问题
Perl是否有su -c "mkdir bin" $USER
或类似的内容?