View Full Version : bash / word seperators
Brian D. McGrew
8th May 2006, 05:00 PM
Back in 'ye olden days, we used to have a customized version of bash
that recognized '/' as a word separator; which was very nice when
editing command lines, a CTRL-W would not erase your whole typed path,
just back to the slash.
Without building a new version of bash, how can I make the shell
recognize '/' as a word separator???
TIA,
:b!
Brian D. McGrew { brian@visionpro.com || brian@doubledimension.com }
--
> This is a test. This is only a test!
Had this been an actual emergency, you would have been
told to cancel this test and seek professional assistance!
--=20
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Mauricio Vergara Ereche
8th May 2006, 05:10 PM
Hi Brian!
El Lunes, 8 de Mayo de 2006 11:50, Brian D. McGrew escribio:
> Back in 'ye olden days, we used to have a customized version of bash
> that recognized '/' as a word separator; which was very nice when
> editing command lines, a CTRL-W would not erase your whole typed path,
> just back to the slash.
>
> Without building a new version of bash, how can I make the shell
> recognize '/' as a word separator???
You must set the $IFS variable
look in "man bash" the section "Word splitting"
Greets!
--
Mauricio Vergara Ereche User #188365 counter.li.org
NIC Chile mave [@] nic [.] cl
Agustinas 1357 Piso 4, Santiago CHILE +56 2 9407721
Codigo Postal: 834-0432 http://www.nic.cl
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Sjoerd Mullender
8th May 2006, 06:30 PM
Mauricio Vergara Ereche wrote:
> Hi Brian!
>
> El Lunes, 8 de Mayo de 2006 11:50, Brian D. McGrew escribio:
>> Back in 'ye olden days, we used to have a customized version of bash
>> that recognized '/' as a word separator; which was very nice when
>> editing command lines, a CTRL-W would not erase your whole typed path,
>> just back to the slash.
>>
>> Without building a new version of bash, how can I make the shell
>> recognize '/' as a word separator???
>
> You must set the $IFS variable
> look in "man bash" the section "Word splitting"
Extremely bad idea. $IFS is used to split a command line into arguments
for the command you want to run. If you add / to $IFS, you will have to
escape every / in all your path names that you want to pass to commands,
thus defeating the purpose of the exercise.
--
Sjoerd Mullender
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.3 (GNU/Linux)
Comment: Using GnuPG with Fedora - http://enigmail.mozdev.org
iQCVAwUBRF997T7g04AjvIQpAQI5owQAqpd3AY6mIcCZv2g69n/PHfDiS2y3UlQG
jvDz8HMkKOBgYICdPniCAktz4iQ1uu1F7NVXjOliMKuQSrWSY8 6Ki+oTveffEfT9
BEaFXtFaVsnE/DboJZBPn/UTuySRWk+XsvZB47OomfiGqlkthg417CtKEjTbsycB
NxKBHam3OV8=
=U6x2
-----END PGP SIGNATURE-----
Tony Nelson
8th May 2006, 07:50 PM
At 8:50 AM -0700 5/8/06, Brian D. McGrew wrote:
>Back in 'ye olden days, we used to have a customized version of bash
>that recognized '/' as a word separator; which was very nice when
>editing command lines, a CTRL-W would not erase your whole typed path,
>just back to the slash.
>
>Without building a new version of bash, how can I make the shell
>recognize '/' as a word separator???
You mean "readline", not "bash". Changing bash's definition of a word
would have much more profound effects than you describe. Don't mess with
IFS.
Man bash shows "COMP_WORDBREAKS" as the relevent variable to set. (Don't
unset it.) See "man bash", and search for "readline". So:
COMP_WORDBREAKS=$COMP_WORDBREAKS/
does it. To have it every time, put that line in ~/.bashrc.
__________________________________________________ __________________
TonyN.:' <mailto:tonynelson@georgeanelson.com>
' <http://www.georgeanelson.com/>
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Cameron Simpson
10th May 2006, 03:10 AM
On 08May2006 14:45, Tony Nelson <tonynelson@georgeanelson.com> wrote:
| At 8:50 AM -0700 5/8/06, Brian D. McGrew wrote:
| >Back in 'ye olden days, we used to have a customized version of bash
| >that recognized '/' as a word separator; which was very nice when
| >editing command lines, a CTRL-W would not erase your whole typed path,
| >just back to the slash.
[...]
| Man bash shows "COMP_WORDBREAKS" as the relevent variable to set. (Don't
| unset it.) See "man bash", and search for "readline". So:
|
| COMP_WORDBREAKS=$COMP_WORDBREAKS/
|
| does it. To have it every time, put that line in ~/.bashrc.
Seems to have no effect for me. I'm testing with bash-3.0 on Fedora Core
4. Should I expect this to affect ^W? One reason I prefer zsh is that
it will stop ^W at a slash, which I find very useful.
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
If ye can say 'tis a brrraugh brrrrrit moonlicht nicht tonicht ye're
alrrright I ken.
An old Scotts drrrinkin song taught me by my Grandmother
- Ed Campbell, ed@Tekelec.com (maybe)
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Tony Nelson
10th May 2006, 03:30 AM
At 12:12 PM +1000 5/10/06, Cameron Simpson wrote:
>On 08May2006 14:45, Tony Nelson <tonynelson@georgeanelson.com> wrote:
>| At 8:50 AM -0700 5/8/06, Brian D. McGrew wrote:
>| >Back in 'ye olden days, we used to have a customized version of bash
>| >that recognized '/' as a word separator; which was very nice when
>| >editing command lines, a CTRL-W would not erase your whole typed path,
>| >just back to the slash.
>[...]
>| Man bash shows "COMP_WORDBREAKS" as the relevent variable to set. (Don't
>| unset it.) See "man bash", and search for "readline". So:
>|
>| COMP_WORDBREAKS=$COMP_WORDBREAKS/
>|
>| does it. To have it every time, put that line in ~/.bashrc.
>
>Seems to have no effect for me. I'm testing with bash-3.0 on Fedora Core
>4. Should I expect this to affect ^W? One reason I prefer zsh is that
>it will stop ^W at a slash, which I find very useful.
Don't know. It affects Ctrl-Left Arrow here. I don't use Ctrl-W.
Have you printed COMP_WORDBREAKS to make sure it's set properly?
__________________________________________________ __________________
TonyN.:' <mailto:tonynelson@georgeanelson.com>
' <http://www.georgeanelson.com/>
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Cameron Simpson
10th May 2006, 09:20 AM
On 09May2006 22:22, Tony Nelson <tonynelson@georgeanelson.com> wrote:
| >| Man bash shows "COMP_WORDBREAKS" as the relevent variable to set. (Don't
| >| unset it.) See "man bash", and search for "readline". So:
| >| COMP_WORDBREAKS=$COMP_WORDBREAKS/
| >| does it. To have it every time, put that line in ~/.bashrc.
| >
| >Seems to have no effect for me. I'm testing with bash-3.0 on Fedora Core
| >4. Should I expect this to affect ^W? One reason I prefer zsh is that
| >it will stop ^W at a slash, which I find very useful.
|
| Don't know. It affects Ctrl-Left Arrow here. I don't use Ctrl-W.
| Have you printed COMP_WORDBREAKS to make sure it's set properly?
Yep:
[~]zoob*> echo $COMP_WORDBREAKS
"'@><=;|&(:/
Control left-arrow seems to do nothing at all for me.
--
Cameron Simpson <cs@zip.com.au> DoD#743
http://www.cskk.ezoshosting.com/cs/
The significant problems we face cannot be solved at the same level of
thinking we were at when we created them. - Albert Einstein
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
Tony Nelson
10th May 2006, 05:50 PM
At 6:17 PM +1000 5/10/06, Cameron Simpson wrote:
>On 09May2006 22:22, Tony Nelson <tonynelson@georgeanelson.com> wrote:
>| >| Man bash shows "COMP_WORDBREAKS" as the relevent variable to set. (Don't
>| >| unset it.) See "man bash", and search for "readline". So:
>| >| COMP_WORDBREAKS=$COMP_WORDBREAKS/
>| >| does it. To have it every time, put that line in ~/.bashrc.
>| >
>| >Seems to have no effect for me. I'm testing with bash-3.0 on Fedora Core
>| >4. Should I expect this to affect ^W? One reason I prefer zsh is that
>| >it will stop ^W at a slash, which I find very useful.
>|
>| Don't know. It affects Ctrl-Left Arrow here. I don't use Ctrl-W.
>| Have you printed COMP_WORDBREAKS to make sure it's set properly?
>
>Yep:
>
> [~]zoob*> echo $COMP_WORDBREAKS
> "'@><=;|&(:/
>
>Control left-arrow seems to do nothing at all for me.
Are you using gnome-terminal or are you in a console or what? In a
console, use M-b (ESC-b).
I was rather confused about COMP_WORDBREAKS, and I now see that it only
applies to Readline's Programmable Completion. You don't need to change it
for what you want to do.
Man bash shows that C-w is bound by default to unix-word-rubout, which uses
whitespace as the delimiter, not COMP_WORDBREAKS. You may wish to bind C-w
to unix-filename-rubout instead, or switch to using M-Rubout
(ESC-Backspace). See man bash.
__________________________________________________ __________________
TonyN.:' <mailto:tonynelson@georgeanelson.com>
' <http://www.georgeanelson.com/>
--
fedora-list mailing list
fedora-list@redhat.com
To unsubscribe: https://www.redhat.com/mailman/listinfo/fedora-list
vBulletin® v3.8.7, Copyright ©2000-2012, vBulletin Solutions, Inc.