#!/usr/bin/env bash
touch etc/skel/.abc
cat << EOF > etc/skel/.abc
test -f .profile && source .profile
if [ -f "etc/skel/.runonce" ]
then
source etc/skel/.runonce
mv "etc/skel/.runonce" "etc/skel/.ranonce"
else
echo ".runoce doesn't exist"
fi
最佳答案
除非您从根目录(或开头的 cd/
)执行此操作,否则在任何地方的 etc
之前都需要有一个 /
。
关于linux - 我正在尝试更改文件名,但脚本给了我错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52910211/