刚学习awk,自己写了一个脚本,好有成就感。
[code:1]#!/bin/bash
# ls_.sh: something used for substituting the shell buildin command "ls" when
# +something wrong with you shell.
DIRECTORY=${1-`pwd`}
echo $DIRECTORY/* | awk '{
for (i = 1; i <= NF; i++) {
sub(/[\/""].*\//, "", $i)
print $i
}
}' | more