Cmon guys, you are making this over complicated :)

Quoting the filename is the key here.

  $ ls -lQ | egrep ^- | awk -F\" '{print $2}'

-- 
regards,
Andre | http://www.varon.ca

On Wed, Jun 4, 2008 at 6:44 AM, Ludwig Isaac Lim <[EMAIL PROTECTED]> wrote:
> Hi:
>
>   I have a script that needs to get a list of regular files only (This means 
> excluding
> directories and symbolic links). Usually the line below works:
>
>       ls -l  | egrep '^-' | awk '{print $9;}'
>
>   However the line above will fail for files having filename with 
> whitespaces. Any other ideas?
>
> Regards,
>
> Ludwig Lim
>
>
>
>
> _________________________________________________
> Philippine Linux Users' Group (PLUG) Mailing List
> http://lists.linux.org.ph/mailman/listinfo/plug
> Searchable Archives: http://archives.free.net.ph
>
_________________________________________________
Philippine Linux Users' Group (PLUG) Mailing List
http://lists.linux.org.ph/mailman/listinfo/plug
Searchable Archives: http://archives.free.net.ph

Reply via email to