Test if variable contains newline (POSIX) – unix.stackexchange.com

I know that some shells accept this kind of test: t() { [[ $var == *$'\n'* ]] && res=yes || res=no printf '%s ' "$res"; } var='ab cd' t var='abcd' t echo on execution: $ bash ...

from Hot Questions - Stack Exchange OnStackOverflow
via Blogspot

Share this

Artikel Terkait

0 Comment to "Test if variable contains newline (POSIX) – unix.stackexchange.com"