I'm learning awk. Trying to do something useful with it by listing all hidden files in ls's long format:
alias llh="ls -la | awk '{ if ( $9 ~ /^\./ ) { print $0 }}'"
This is resulting in an error, however:
awk: cmd. line:1: { if ( ~ /^\./ ) { print -bash }} awk: cmd. line:1: ^ syntax error The $9 isn't showing in the error output. Maybe because it's empty? So I tried:
alias llh="ls -la | awk '{ if ( $9 && $9 ~ /^\./ ) { print $0 }}'"
Still no luck.