Re: [9fans] simple question: multiple rename

2009-06-18 Thread erik quanstrom
On Thu Jun 18 18:55:30 EDT 2009, slawmas...@gmail.com wrote: > On Tue, Jun 16, 2009 at 4:01 PM, erik quanstrom wrote: > > > > > I forgot, / is actually illegal. I'm almost (but not quite) certain that > > > \0 is legal, and if I understand my emacs correctly you may be able to > > > type it as c

Re: [9fans] simple question: multiple rename

2009-06-18 Thread John Floren
On Tue, Jun 16, 2009 at 4:01 PM, erik quanstrom wrote: > > > I forgot, / is actually illegal. I'm almost (but not quite) certain that \0 > > is legal, and if I understand my emacs correctly you may be able to type it > > as ctrl-space. It displays as ^@ in emacs. > > > > what system call do you

Re: [9fans] simple question: multiple rename

2009-06-17 Thread Ethan Grammatikidis
On Tue, 16 Jun 2009 19:01:43 -0400 erik quanstrom wrote: > > I forgot, / is actually illegal. I'm almost (but not quite) certain that \0 > > is legal, and if I understand my emacs correctly you may be able to type it > > as ctrl-space. It displays as ^@ in emacs. > > > > what system call do y

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Ethan Grammatikidis
On Tue, 16 Jun 2009 11:55:42 -0400 j...@csplan9.rit.edu wrote: > > On Tue, 16 Jun 2009 08:00:44 -0400 > > erik quanstrom wrote: > > > >> > note that this won't work if the filenames contain white space. > >> > > >> > (i still regret the fact that white space became allowable in file names) > >>

Re: [9fans] simple question: multiple rename

2009-06-16 Thread erik quanstrom
> I forgot, / is actually illegal. I'm almost (but not quite) certain that \0 > is legal, and if I understand my emacs correctly you may be able to type it > as ctrl-space. It displays as ^@ in emacs. > what system call do you use to create a file with \0 in the name? i'm not really keeping up,

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Ethan Grammatikidis
On Tue, 16 Jun 2009 08:52:43 -0400 erik quanstrom wrote: > > So what happens when you drawterm from a un*x box or access a VFAT > > partition? > > nothing. i'm running ken's fs, so from drawterm i have > > ; echo > 'silly file' > ; lc silly* > 'silly file' > ; cd /tmp

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Ethan Grammatikidis
> > >The Evolution of Conciousness in the Breakdown of the Bicameral Mind.doc > > > > it's not worth worrying about for that book (i think it's `Origin' not > > `Evolution') > > i am astounded it keeps resurfacing. > > those crazy nebraskans. Don't mind me I'm just quoting Hitchhiker's Guide to

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Francisco J Ballesteros
We always use trfs in the 9fs script. It's so convenient that we forgot it's there. I think it's in contrib. Otherwise let me know. El 16/06/2009, a las 17:58, j...@csplan9.rit.edu escribió: On Tue, 16 Jun 2009 08:00:44 -0400 erik quanstrom wrote: note that this won't work if the filenames

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Tim Newsham
I believe it was Nemo et al. who wrote trfs, which does essentially what you want--it stands between you and your badly-named files, presenting spaces as underscores or something to that effect. In inferno (at least in acme-sac) the spaces coming from my native (windows) filesystem are translat

Re: [9fans] simple question: multiple rename

2009-06-16 Thread john
> On Tue, 16 Jun 2009 08:00:44 -0400 > erik quanstrom wrote: > >> > note that this won't work if the filenames contain white space. >> > >> > (i still regret the fact that white space became allowable in file names) >> >> using ws in filenames is a fossil-only problem; >> kfs, cwfs and ken's fs

Re: [9fans] simple question: multiple rename

2009-06-16 Thread erik quanstrom
> >The Evolution of Conciousness in the Breakdown of the Bicameral Mind.doc > > it's not worth worrying about for that book (i think it's `Origin' not > `Evolution') > i am astounded it keeps resurfacing. those crazy nebraskans. - erik

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Charles Forsyth
>The Evolution of Conciousness in the Breakdown of the Bicameral Mind.doc it's not worth worrying about for that book (i think it's `Origin' not `Evolution') i am astounded it keeps resurfacing.

Re: [9fans] simple question: multiple rename

2009-06-16 Thread erik quanstrom
> if you are trying to disallow space you'd have > to fiddle with every file server you could possibly > talk to, or you'd have to edit the kernel. > the barn door has been open for a decade. my point was only that i agree with roger; spaces in filenames are a pain and it would be best not to let

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Russ Cox
the easiest thing to do is not use spaces in your file names, even if others do in theirs. most people take that approach, even on unix, and it works fine. if you are worried about names with spaces and want to make a script more robust, then the simplest option is to set ifs=' ' while you are man

Re: [9fans] simple question: multiple rename

2009-06-16 Thread erik quanstrom
> So what happens when you drawterm from a un*x box or access a VFAT partition? nothing. i'm running ken's fs, so from drawterm i have ; echo > 'silly file' ; lc silly* 'silly file' ; cd /tmp ; echo > 'silly file' silly file: rc: can't open: 'sill

Re: [9fans] simple question: multiple rename

2009-06-16 Thread Ethan Grammatikidis
On Tue, 16 Jun 2009 08:00:44 -0400 erik quanstrom wrote: > > note that this won't work if the filenames contain white space. > > > > (i still regret the fact that white space became allowable in file names) > > using ws in filenames is a fossil-only problem; > kfs, cwfs and ken's fs won't allow

Re: [9fans] simple question: multiple rename

2009-06-16 Thread erik quanstrom
> note that this won't work if the filenames contain white space. > > (i still regret the fact that white space became allowable in file names) using ws in filenames is a fossil-only problem; kfs, cwfs and ken's fs won't allow it. fortunately, fossil is easy to fix /n/dump/2009/0616/sys/src/cmd

Re: [9fans] simple question: multiple rename

2009-06-16 Thread roger peppe
2009/6/8 Russ Cox > On Mon, Jun 8, 2009 at 12:50 AM, Rudolf Sykora wrote: > > Hello, > > Still wonder, what's the right way to make the following work: > > The right way is > > s=`{echo $i | sed 's/(.+)_g/\1/'}. note that this won't work if the filenames contain white space. (i still regret the

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Rudolf Sykora
> should be written as: > s = `{sam -d <[2] /dev/null} >... >EOF > > Hope that helps, >Martin OK, now I see. The } was at the wrong place... Thanks Martin thanks Russ, too. Ruda

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Martin Neubauer
Hello Ruda, Due to the peculiarities of here documents in rc the following: > s = `{sam -d <[2] /dev/null > 1s/(.+)_g/\1 > p > EOF >} should be written as: s = `{sam -d <[2] /dev/null} ... EOF Hope that helps, Martin

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Russ Cox
On Mon, Jun 8, 2009 at 12:50 AM, Rudolf Sykora wrote: > Hello, > Still wonder, what's the right way to make the following work: The right way is s=`{echo $i | sed 's/(.+)_g/\1/'}. > s = `{sam -d <[2] /dev/null >        1s/(.+)_g/\1 >        p >        EOF >       } If you must use sam, the righ

Re: [9fans] simple question: multiple rename

2009-06-08 Thread Rudolf Sykora
Hello, Still wonder, what's the right way to make the following work: This is ok: sam -d <[2] /dev/null 1s/(.+)_g/\1 p EOF but now I want it all be inside `{}, like s = `{sam -d <[2] /dev/null 1s/(.+)_g/\1 p EOF } which doesn't work. I tri

Re: [9fans] simple question: multiple rename

2009-06-05 Thread Rudolf Sykora
> sed is your friend: > > s=`{ echo $i | sed -e 's/_g_b/_g/' } > > > Martin Oh yes, that's it. Thanks Ruda

Re: [9fans] simple question: multiple rename

2009-06-05 Thread Martin Harriss
Rudolf Sykora wrote: Hello, I realized I cannot come up with a simple solution for the following. I want to rename all the files whose names end with _g_b to just _g, e.g. hello_g_b should be renamed to hello_g. I simply don't know an easy way. [the opposite way is simple: for(i in *_g) mv $i $i

[9fans] simple question: multiple rename

2009-06-05 Thread Rudolf Sykora
Hello, I realized I cannot come up with a simple solution for the following. I want to rename all the files whose names end with _g_b to just _g, e.g. hello_g_b should be renamed to hello_g. I simply don't know an easy way. [the opposite way is simple: for(i in *_g) mv $i $i^_b ] I only think abou