vieyahn2017 / shellv

shell command test and study
4 stars 1 forks source link

4.28 ls 输出全路径 #66

Open vieyahn2017 opened 4 years ago

vieyahn2017 commented 4 years ago

ls 输出全路径

vieyahn2017 commented 4 years ago
ls | awk -v a=$(pwd) '{print a"/"$0}'
vieyahn2017 commented 4 years ago

awk -v awk: option requires an argument -- v Usage: awk [POSIX or GNU style options] -f progfile [--] file ... Usage: awk [POSIX or GNU style options] [--] 'program' file ... POSIX options: GNU long options: (standard) -f progfile --file=progfile -F fs --field-separator=fs -v var=val --assign=var=val