Skip to content

Instantly share code, notes, and snippets.

@ARolek
Created February 24, 2020 18:59
Show Gist options
  • Save ARolek/91df1f4e8ced5331f7914c8a97f61ffb to your computer and use it in GitHub Desktop.
Save ARolek/91df1f4e8ced5331f7914c8a97f61ffb to your computer and use it in GitHub Desktop.
detecting tabs in bash
#/bin/bash
str="AIN TRA"
delimiter=$(echo $str | perl -ne "print /AIN(.{1})/")
echo "delimiter is '$delimiter'"
if [[ $delimiter = [^\t] ]]; then
echo "ok"
else
echo "no"
fi
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment