Pythonコードでzipファイルを作成するワンライナーを作りたいです。ただし、Makefile で実行すると、デフォルトのシェル (ダッシュ) が使用されます。それは
bash$ dash
dash$ zip --exclude '.git/*' --exclude '*.swp' --exclude '*.pyc' --exclude 'tool' --exclude Makefile -r - . | cat <(echo '#!/usr/bin/env python') - > externaltool
dash: 1: Syntax error: "(" unexpected
dash$ exit
しかし、bashでは完全にうまく機能します
bash$ zip --exclude '.git/*' --exclude '*.swp' --exclude '*.pyc' --exclude 'externaltool' --exclude Makefile -r - . | cat <(echo '#!/usr/bin/env python') - > externaltool
adding: common/ (stored 0%)
adding: common/config.py (deflated 19%)
adding: common/cmdwrap.py (deflated 65%)
adding: common/extconfig.py (deflated 71%)
adding: common/commands.py (deflated 19%)
adding: common/__init__.py (stored 0%)
adding: __main__.py (deflated 45%)
cat <(echo '#!/usr/bin/env python') - in dashを表現する方法はありますか?
Makefileに追加できることを知っています
SHELL := /bin/bash
しかし、それは恒久的な解決策ではなく単なる回避策です。