OT: Regex question

Mark T. Valites yellowdog-general@lists.terrasoftsolutions.com
Sat May 4 11:20:01 2002


Ah yes, the painfully obvious.  I apologize for not having tried it out
before haveing made the suggestion.

On Sat, 4 May 2002, Keary Suska wrote:

> Date: Sat, 04 May 2002 11:13:44 -0600
> From: Keary Suska <hierophant@pcisys.net>
> Reply-To: yellowdog-general@lists.terrasoftsolutions.com
> To: Yellow Dog Linux <yellowdog-general@lists.terrasoftsolutions.com>
> Subject: Re: OT: Regex question
>
> on 5/4/02 10:32 AM, valites@geneseo.edu purportedly said:
>
> >
> >> Just to clarify, the above example would fail for because of the -l option
> >> passed to ls. You want just the file names, not the additional info that a
> >> long listing provides.
> >>
> >> $ tar cvf output_file.tar `ls -da [^A-Z]* | grep -v /path/to/file/to/skip`
> >>
> >
> >
> > Without the -l, aren't the basenames of filenames outputted from the
> > backtick interpreted as being in the cwd?
>
> They are, whether or not -l is used. -l is simply specifying the long
> listing display, but whether the file names contain path information depends
> solely on the path specified to ls. hence:
>     $ ls -da [^A-Z]*
> contains no path info, so matching file names in the cwd will be shown
> without path info, regardless of the use of -l. However,
>     $ ls -da /path/to/[^A-Z]*
> will return a listing with each file name as /path/to/file_name, also,
> regardless of the use of -l.
>
> The problem with using -l is that you effectively get something like:
>     $ tar cfv file.tar -rw-r--r-- 1 user group   1704874 Jan 19 17:32 file
>
> which will choke tar, especially since it will look at the permissions as
> options, and will look for files with names "1", "user", "group", etc.
>
> Keary Suska
> Esoteritech, Inc.
> "Leveraging Open Source for a better Internet"
>
> _______________________________________________
> yellowdog-general mailing list
> yellowdog-general@lists.terrasoftsolutions.com
> http://lists.terrasoftsolutions.com/mailman/listinfo/yellowdog-general
>

>--))> >--))>
Mark T. Valites
Unix Systems Analyst
1 College Circle - 124b1 South Hall
SUNY Geneseo
Geneseo, NY 14454
585-245-5577
585-259-3471 (Cell)