grub 구성 파일을 이해하려고합니다. 따라서이 과정에서 /etc/grub.d/40_custom 파일을 발견했습니다 . 내 파일에는 다음 줄이 포함되어 있습니다.
#!/bin/sh
exec tail -n +3 $0
# This file provides an easy way to add custom menu entries. Simply type the
# menu entries you want to add after this comment. Be careful not to change
# the 'exec tail' line above.
menuentry "Windows 10" --class windows --class os {
insmod part_msdos
savedefault
insmod ntfs
insmod ntldr
set root='(hd0,msdos1)'
ntldr ($root)/bootmgr
}
내 시스템은 이중 부팅이므로 분명히 이것은 Windows 10 용 부트 로더입니다.
내 질문은이 부분 exec tail -n +3 $0입니다.
내가 올바르게 해독하는 경우 이것은 +3파일 의 세 번째 줄 ( ) 에서 시작하여 마지막 줄을 인쇄한다는 의미 $0입니다. $0물론이 경우 실제 파일 /etc/grub.d/40_custom 입니다.
그렇다면 왜이 명령을 40_custom 파일 에서 사용 합니까? 내가 그것을 얻을 때 출력이 완전히 생략되면 출력은 동일합니다. 내가 생각할 수있는 유일한 것은 통역사를 식별하는 첫 번째 줄입니다.
#!/bin/sh
그러나 그런 다음 다시 실행 exec tail -n +3 $0됩니다. 그렇다면 이것은 단지 쓸모없는 규칙입니까?
#!/bin/tail -n +2가 쉘뱅으로 쓰면 어떨까요? 파일의 나머지 부분을 인쇄합니까?