Bash'de, -xseçenekle çalışırken , tek tek komutların yankılanmasından muaf olması mümkün müdür?
Çıktıyı olabildiğince düzgün hale getirmeye çalışıyorum, bu yüzden komut dosyamın bazı bölümlerini bir alt kabukta çalıştırıyorum set +x. Bununla birlikte, satırın set +xkendisi hala yankılanır ve çıktıya değerli bir bilgi eklemez.
Kötü eski .batgünlerde hatırlıyorum , koşarken echo on, bireysel çizgiler a ile başlayarak muaf tutulabilir @. Bash'de eşdeğeri var mı?
#!/bin/bash -x
function i_know_what_this_does() {
(
set +x
echo do stuff
)
}
echo the next-next line still echoes 'set +x', is that avoidable?
i_know_what_this_does
echo and we are back and echoing is back on
Yukarıdakileri çalıştırırken, çıktı:
+ echo the next-next line still echoes 'set +x,' is that 'avoidable?'
the next-next line still echoes set +x, is that avoidable?
+ i_know_what_this_does
+ set +x
do stuff
+ echo and we are back and echoing is back on
and we are back and echoing is back on