Aşağıdaki betiğe sahibim:
#!/bin/bash
set -x
if :; then
echo a
fi
Koşarsam bash /tmp/file, ayankılandı, ama ben çalıştırırsanız source /tmp/file, alıyorum:
bash: /tmp/test: line 6: syntax error: unexpected end of file
Çıktı:
knezi@holly tmp]$set -x; source /tmp/test; set +x
+ source /tmp/test
++ set -x
bash: /tmp/test: line 6: syntax error: unexpected end of file
+ set +x
knezi@holly tmp]$set -x; command source /tmp/test; set +x
+ set -x
+ command source /tmp/test
+ source /tmp/test
++ set -x
bash: /tmp/test: line 6: syntax error: unexpected end of file
+ set +x
knezi@holly tmp]$bash -c "source /tmp/test"
+ bash -c 'source /tmp/test'
++ :
++ echo a
a
knezi@holly tmp]$od -c /tmp/test
0000000 # ! / b i n / b a s h \n s e t
0000020 - x \n i f : ; t h e n \n \t e
0000040 c h o a \n f i \n
0000051
Komutların çıktısı shopt -pve set -o: http://pastebin.com/bsqc8aru
Çıktı set: http://pastebin.com/S9KpqZAL
declare -fp hiçbir şey üretmez.
Ben sourcede aynı şeyi düşündüm bash, fakat yeni oturum başlatmak yerine o anki koddaki kodu çalıştırıyoruz. Birisi bu hatayı bana açıklayabilir mi?
Bash GNU bash, sürüm 4.2.53 (1) - tekrar yayın (x86_64-redhat-linux-gnu) kullanıyorum.
$BASH_ENVseti?
bash -csorunuza uygun olduğunu ekleyin. Ardından, bize ~/.bashrcdosyanızın içeriğini gösterin , muhtemelen bir şeyleri mahvedecek bir şey var.