10-03-04 02:13 AM
Hi,
I'm trying to write a little bash (version 2.05a.0 on GNU/Linux Debian
woody) script that list à directory tree to change user/rights permission :
#!/bin/bash
for item in `ls -AlQ /mnt/data/divx | grep -v total`
do
echo $item
done
I would get into the variable $item something like that :
-rwxr-xr-x 1 rico staff 270193540 sep 4 2003 "a_file.txt"
But in reality each line generated by ls command is splitted into 9 list
element, so I get for each loop iteration :
-rwxr-xr-x
1
rico
staff
...
So what sould I do to get only 1 list item for each line reported by ls
command ?
regards,
--
Rico
[ Post a follow-up to this message ]
|