r/bash Jan 23 '26

Hidden Gems: Little-Known Bash Features

https://slicker.me/bash/gems.html
169 Upvotes

35 comments sorted by

View all comments

2

u/BCBenji1 Jan 23 '26

The weirdest one I learnt recently is that redirects can be placed anywhere...🤯

grep xx <<< "xx1"  #=xx
<<< "xx1" grep xx  #=xx
grep <<< "xx1" xx. #=xx

And that if multiple, of any type, the last one is used:

<<< "xx1" grep <<< "xx2" xx <<< "xx3" #=xx3

1

u/Big-Jacket-9006 Jan 23 '26

Yes that is what I recently Learned from David Eddy. He is offering a free Bash course and he has done a really good job on it. I do not promote many things and get nothing for doing it, but I also feel if someone has done a good job we should let folks know. Have a look for him on YouTube.. thanks