I have this in my makefile
test:
cat t.txt | sort -t $$'\t' -k 2,2
But “make test” gives me this error
cat t.txt | sort -t $’\t’ -k 2,2
sort: multi-character tab `$\t’
make: * [test] Error 2
Works fine on Redhat linux but fails on Ubuntu linux
The
$'\t'syntax you’re trying to use is a bash-ism, but by default gmake uses/bin/shas the shell. You can either override the SHELL variable in your makefile, as in:or explicitly invoke bash for this specific command: