So, I have a directory containing around 50 directories having for name 3 letter uppercase words: AXC BCC EFC
amongst other directories.
I have already done a find to seek these 3 letter directories and store them in a list
list=`find /data/opr/ucansit/ -type d -name "???"`
The current output i get from an echo ${list[@]}
is
/data/opr/ucansit/CUG /data/opr/ucansit/TGV /data/opr/ucansit/PAS
what i need now is seek the 3 letter directory names and store them in a stack as:
CUG
TGV
PAS
Note: I just need the names of the directories (the 3 letters)
BRegards,
(cd /data/opr/ucansit; set -- ???; printf '%s\n' "$@")
is ok – cuonglm Mar 24 '16 at 9:34