print, like echo but simpler and more consistent than oche

# oche (see previous post) was OK, but it still had some consistency issues around mutli-line input.
function print { local line="$@"; printf "%s\n" "$line"; }
Alexanders-MacBook-Pro:~ alexanderturner$ print a bc
a bc
Alexanders-MacBook-Pro:~ alexanderturner$ print 'abc
> df'
abc
df
Alexanders-MacBook-Pro:~ alexanderturner$ print 1 2 34 5
1 2 34 5
Alexanders-MacBook-Pro:~ alexanderturner$ print {1..3}
1 2 3

Alexanders-MacBook-Pro:~ alexanderturner$ print "$(print {1..3} | tr ' ' '\n')"
1
2
3

Comments

Popular posts from this blog

List to data

bash 'header' files

Mass Deleting With split and map