[lug] I need help from a bash scripting guru

Paul E Condon pecondon at mesanetworks.net
Mon Jan 7 12:49:27 MST 2008


On Mon, Jan 07, 2008 at 05:29:02PM +0000, Zan Lynx wrote:
> 
> On Sun, 2008-01-06 at 22:59 -0700, David L. Anselmi wrote:
> > Paul E Condon wrote:
> > > I'm working on a file backup script that has a feature
> > > of my own design. I have written a script that uses 
> > 
> > Yeah, I did that once.  Never again.  rdiff-backup might do what you 
> > want and be easier to run than rsync.
> > 
> > > Put another way - Is there one character that never appears in file
> > > names of all these OSs, and can be introduced as the field delimiter
> > > into GNU join?
> > 
> > The only characters not allowed in UNIX file names are / and null 
> > (AFAIK).  Those aren't terribly suitable for your purpose so I'd guess 
> > the answer is, "no."
> > 
> > But you could try \n or \r.
> 
> Join needs two delimiters, one for fields and one for lines.  So, there
> isn't any way to use a newline to separate fields because then what
> would it use to separate lines?
> 

When I'm using back-quote, I don't actually have any back-quote field
delimiters in the input files. The sole effect is to disable
delimiting fields at the spaces.  I _want_ the whole line to be
treated as one field, which happens if no field delimiter is found.

But you make a valid point about using new-line conflicting with the
logic for finding end-of-record, which is also necessary. So, I have
to drop new-line from my list of candidate characters. 

Its beginning to look like I can't get what a want.

Thanks to all.

-- 
Paul E Condon           
pecondon at mesanetworks.net



More information about the LUG mailing list