1

I thought this would be pretty straight forward

echo "1§2" | cut -d § -f 2

should give "2", right? But whatever I try

echo "1§2" | cut -d § -f 2 
echo "1§2" | cut -d \§ -f 2
echo "1§2" | cut -d "§" -f 2 
echo "1§2" | cut -d '§' -f 2 

I always get

cut: the delimiter must be a single character

Does someone know why? § does not seem to be a special character in any way.

1
  • compare echo 'a' | xxd -c 1 to echo '§' | xxd -c 1. welcome to the wonderful world of Unicode :) – quixotic Feb 21 '17 at 13:52
0

§ seems to be no single byte character as pointed out in the comment Use section sign § as cut delimiter

cut can only work with single byte characters

related https://unix.stackexchange.com/a/163725

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.