
5개 또는 10개 등 많은 명령을 순서대로 실행해야 합니다. 하지만 모두 경로를 처리하므로 각각 90자로 매우 길어서 &&가 작동하지 않을 수 있습니다.
해결책이 있나요?
완료되고 성공한 후에만 실행하고 싶습니다.
답변1
이를 한 줄씩 쉘 스크립트에 입력하고 각 줄을 a로 끝냅니다 \
(개행 문자는 이스케이프됩니다).
#!/bin/bash
command1 /very/long/path/to/directory && \
command2 /another/very/long/path/to/directory && \
command3 /and/another/very/long/path/to/another/directory && \
echo "Command sequence finished succesfully"