0
#!/bin/sh -x
if [[ $# -eq 0 ]];then
echo "usage: makeSoln <customer name>"
exit
fi
echo "Customer Name is set to : $1"
if [ -d "$1" ]; then
echo "Solution for $1 already exists!! Please delete it before running this."
exit 1;
fi
if [ -e "$1" ]; then
echo "A file by name '$1' exists!! Please delete it before running this."
exit 1;
fi
cp -R SolnTemplate $1
cd $1
find . -name "pom.xml" | xargs sed -i xx 's/SolnTemplate/'$1'/g'
當我給出的這個和執行這個文件我正在流汗此錯誤:Linux的shell腳本的sed
+ xargs sed -e xx s/SolnTemplate/Reliance/g
sed: -e expression #1, char 2: extra characters after command
從錯誤消息看來,您看起來像是'sed -e xx'而不是'sed -i xx'。 –