How to read those files and output to base?

Hi,

-rwxr-xr-x  1 abc mkpasswd 2483 Oct 20 15:42 0132200710-ps5_cdrm.unl
-rwxr-xr-x  1 abc mkpasswd 1826 Oct 20 15:43 0132200710-ps5_cdrn.unl
-rwxr-xr-x  1 abc mkpasswd 1788 Oct 20 15:44 0132200710-ps5_cdro.unl
-rwxr-xr-x  1 abc mkpasswd 1681 Oct 20 15:44 0132200710-ps5_cdrp.unl
-rwxr-xr-x  1 abc mkpasswd 1373 Oct 20 15:45 0132200710-ps5_cdrq.unl
-rwxr-xr-x  1 abc mkpasswd 1371 Oct 20 15:45 0132202469-ps5_cdrm.unl
-rwxr-xr-x  1 abc mkpasswd 1559 Oct 20 15:46 0132202469-ps5_cdrn.unl
-rwxr-xr-x  1 abc mkpasswd 2121 Oct 20 15:47 0132202469-ps5_cdro.unl

I have list of files as above for eg, I wanted to have my end output result for all
0132200710unl to be in one single file, and all 0132202469unl and so forth..

Please help.

check the cat man page.

You can do something like that :

ls *-*.unl | \
while read file
do
   root=$(echo $file | cut -d- -f1)
   cat $file >> $root.unl
done

Jean-Pierre.

With zsh:

set -- *unl
for f (${(u)${@%-*}}) print -rl "$f"*>"$f"_all

Otherwise:

for f in *unl;do printf "%s\n" "$f">>"${f%-*}"_all;done

hey just try,
ls -1 <<search pattrn>>*unl >> filename.txt