여기에 재생됩니다 인수, VLC 보트 및 디렉토리 트리에서 파일을 실행 동적 재생 목록왜이 bash 스크립트는 vlc를 두 번 실행합니까?
#!/bin/bash
find "/path/to/music" -type f -path "*$1*" -print0 | xargs -0 vlc
와 VLC를 시작하기위한 내가 가진 스크립트입니다.
그런 다음 vlc를 닫고 다른 인스턴스가 시작됩니다. 내가
find "/path/to/music" -type f -path "**"
의 출력에 각 인스턴스의 재생 목록을 비교하면
그것은 첫 번째 인스턴스가 재생 목록의 대부분을 가져 와서 두 번째 인스턴스가 나머지를 얻는 것으로 나타났다. 분할은 결정적입니다.
...
/path/to/music/Liz Carroll/Lost in the Loop/08 - The Crow in the Sun.ogg
/path/to/music/Liz Carroll/Lost in the Loop/02 - The Champaign Jig Goes To Columbia, Pat and Al's.ogg
/path/to/music/Liz Carroll/Lost in the Loop/04 - The Golden Legs, The Flogging Reel.ogg
/path/to/music/Liz Carroll/Lost in the Loop/09 - The Ugly Duckling.ogg
/path/to/music/Liz Carroll/Lost in the Loop/03 - See It There, Con Cassidy's.ogg
/path/to/music/Liz Carroll/Lost in the Loop/13 - The Didda, Fly and Dodger.ogg
/path/to/music/Eliza Carthy/Dreams of Breathing Underwater/08 Little Bigman.mp3
/path/to/music/Eliza Carthy/Dreams of Breathing Underwater/07 Lavenders.mp3
...
분할은 항상 마지막 세 개의 파일이 두 번째 인스턴스의 재생 목록에서 처음이되도록 일 다음은 위 명령의 출력의 추출물이다. 거기에 트릭 문자가없는 것 같습니다. 아포스트로피를 묶는 파일 이름은 vlc 재생 목록에 나타나야합니다. 아무 것도없는 것처럼 보이며 vlc는 오류를 출력하지 않습니다.
왜 vlc의 첫 번째 인스턴스는 find
의 출력에있는 모든 파일을 가져 오지 못합니까?
왜 나머지 부분을 가져 오는 두 번째 인스턴스가 있습니까?
스크립트에서'cd "/ path/to/music"을 사용하여 경로를 단축 할 수 있습니다 (모든 경로를 하나의 호출로 넣을 수 있습니다). {echo "오류 cd'ing"> & 2; 출구 1; }', then find. -type f ...' –