terminal İştebash sözdizimi hatası: "(" bu işlev düzgün çalışıyor Nedense beklenmedik
newbootstrap.sh: 2: Syntax error: "(" unexpected
çıktısı benim kodudur (hat 2 fonksiyon MoveToTarget() {
)
#!/bin/bash
function MoveToTarget() {
#This takes to 2 arguments: source and target
cp -r -f "$1" "$2"
rm -r -f "$1"
}
function WaitForProcessToEnd() {
#This takes 1 argument. The PID to wait for
#Unlike the AutoIt version, this sleeps 1 second
while [ $(kill -0 "$1") ]; do
sleep 1
done
}
function RunApplication() {
#This takes 1 application, the path to the thing to execute
exec "$1"
}
#our main code block
pid="$1"
SourcePath="$2"
DestPath="$3"
ToExecute="$4"
WaitForProcessToEnd $pid
MoveToTarget $SourcePath, $DestPath
RunApplication $ToExecute
exit
Teşekkürler! Şimdi mantıklı. Bunu yapan bazı web siteleri gördüm. – rsmith
Web sitesinin yanlış olduğunu @rsmith. –
@rsmith Siteyi adlandırın ya da bir rüyaydı :-) – Jens