I'd like to write an alias that would print particular line from all files in a folder, i.e.:
$ print_line 20
- would print 20th line from all files in a folder.
I spent hour with various constructions in .bashrc (some examples below), with lot of different escaping, but so far nothing worked. Thanks for any help.
alias a="for f in create*; do sed -n '\$1{p;q}' $f; done"
alias b="for f in create*; do awk 'NR==\$1{print $0}' $f; done"
function l { r=$(echo \'"$1"{p;q}\'); sed -n "$r" *; }