ฉันกำลังพยายามใช้ find -exec ที่มีหลายคำสั่งโดยไม่ประสบความสำเร็จ ใครบ้างรู้ว่าคำสั่งดังต่อไปนี้เป็นไปได้?
find *.txt -exec echo "$(tail -1 '{}'),$(ls '{}')" \;
โดยทั่วไปฉันพยายามพิมพ์บรรทัดสุดท้ายของแต่ละไฟล์ txt ในไดเรกทอรีปัจจุบันและพิมพ์ที่ท้ายบรรทัดชื่อคอมม่าตามด้วยชื่อไฟล์
findหน้าคู่มือ: There are unavoidable security problems surrounding  use  of  the  -exec  option;  you should use the -execdir option instead.unixhelp.ed.ac.uk/CGI/man-cgi?find