1
bash line จะดำเนินการต่อหลังจาก && และ || เอกสาร?
ฉันได้เห็นโครงสร้างนี้ในสคริปต์จำนวนมากและใช้มันเอง แต่มันทำให้ฉันรำคาญใจที่ฉันไม่สามารถหามันได้ในเอกสารประกอบ ตัวอย่าง: [ -f file1 ] && [ -f file2 ] && echo "Both files exist." || echo "One or the other file doesn't exist." สิ่งนี้สามารถทำได้ด้วยแบ็กสแลชก่อนขึ้นบรรทัดใหม่ดังที่ได้กล่าวไว้ในman bash: If a \<newline> pair appears, and the backslash is not itself quoted, the \<newline> is treated as a line continuation (that is, …
28
bash
shell-script