RFE: history without line numbers

2012-03-13 Thread Biltong
To make copy-pasting between different terminals work better, would it be possible for the history built-in to support an option to suppress line numbers? -- Biltong bilt...@fastmail.fm -- http://www.fastmail.fm - A no graphics, no pop-ups email service

Re: RFE: history without line numbers

2012-03-13 Thread Steven W. Orr
On 3/13/2012 5:27 AM, Biltong wrote: To make copy-pasting between different terminals work better, would it be possible for the history built-in to support an option to suppress line numbers? Why would you want that? 507 spam xxx.eml 508 cd .jpilot 509 grep -i poisson AddressDB.pdb

Re: RFE: history without line numbers

2012-03-13 Thread Chet Ramey
On 3/13/12 5:27 AM, Biltong wrote: > To make copy-pasting between different terminals work better, would it > be possible for the history built-in to support an option to suppress > line numbers? fc -n -l low high e.g., fc -n -l 50 530 -- ``The lyf so short, the craft so long to lerne.'' - Cha

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Chet Ramey
On 3/12/12 12:22 AM, Yongzhi Pan wrote: > Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. > > Upon login, home dir is displayed as tilde in PS1: > pan@BJ-APN-2 ~$ echo $PS1 > \[\033[35m\]\u@\h \w$ \[\033[0m\] > pan@BJ-APN-2 ~$ pwd > /export/home/pan/ > > After a cd command, w

Re: RFE: history without line numbers

2012-03-13 Thread Biltong
Great! Thanks. Would it be good to mention fc under history in the manpage? On Tue, Mar 13, 2012, at 08:43 AM, Chet Ramey wrote: > On 3/13/12 5:27 AM, Biltong wrote: > > To make copy-pasting between different terminals work better, would it > > be possible for the history built-in to support an op

Re: RFE: history without line numbers

2012-03-13 Thread Chet Ramey
On 3/13/12 9:18 AM, Biltong wrote: > Great! Thanks. Would it be good to mention fc under history in the > manpage? This is from the HISTORY section: "The builtin command fc (see SHELL BUILTIN COMMANDS below) may be used to list or edit and re-execute a portion of the history list. The his- tor

Re: RFE: history without line numbers

2012-03-13 Thread Biltong
I looked under help history I can't see fc mentioned. On Tue, Mar 13, 2012, at 09:21 AM, Chet Ramey wrote: > On 3/13/12 9:18 AM, Biltong wrote: > > Great! Thanks. Would it be good to mention fc under history in the > > manpage? > > This is from the HISTORY section: > > "The builtin command fc

Re: RFE: history without line numbers

2012-03-13 Thread Chet Ramey
On 3/13/12 9:47 AM, Biltong wrote: > I looked under > help history > I can't see fc mentioned. Well, yes. `help history' displays information about the history builtin. The text I quoted was from the manual page. -- ``The lyf so short, the craft so long to lerne.'' - Chaucer

Re: RFE: history without line numbers

2012-03-13 Thread Greg Wooledge
On Tue, Mar 13, 2012 at 02:47:44PM +0100, Biltong wrote: > I looked under > help history > I can't see fc mentioned. The builtin "help" only gives you a short summary of a single command's options. It is not an exhaustive reference. For the complete story, you must read the man page, or the web

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 06:04, schrieb Clark J. Wang: On Mon, Mar 12, 2012 at 12:22, Yongzhi Pan wrote: Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. Upon login, home dir is displayed as tilde in PS1: pan@BJ-APN-2 ~$ echo $PS1 \[\033[35m\]\u@\h \w$ \[\033[0m\] pan@BJ-APN-2 ~$ pwd

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Roman Rakus
On 03/13/2012 04:08 PM, dethrophes wrote: Am 13.03.2012 06:04, schrieb Clark J. Wang: On Mon, Mar 12, 2012 at 12:22, Yongzhi Pan wrote: Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. Upon login, home dir is displayed as tilde in PS1: pan@BJ-APN-2 ~$ echo $PS1 \[\033[35m

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 09:18 AM, Roman Rakus wrote: >> as a workaround to your problem you could have something like this in >> your bashrc >> if shopt extglob &>/dev/null ; then >> HOME="${HOME/%+(\/)}" # strip all trailing forward slashes >> else >>while [ "${HOME}" != "${HOME%\/}" ] ; do >>

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 16:18, schrieb Roman Rakus: On 03/13/2012 04:08 PM, dethrophes wrote: Am 13.03.2012 06:04, schrieb Clark J. Wang: On Mon, Mar 12, 2012 at 12:22, Yongzhi Pan wrote: Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. Upon login, home dir is displayed as tilde

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 16:27, schrieb Eric Blake: On 03/13/2012 09:18 AM, Roman Rakus wrote: as a workaround to your problem you could have something like this in your bashrc if shopt extglob&>/dev/null ; then HOME="${HOME/%+(\/)}" # strip all trailing forward slashes else while [ "${HOME}" !=

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 09:27 AM, Eric Blake wrote: > Be aware that both approaches will misbehave if HOME is a root directory > (/ or //), where you _don't_ want to strip trailing slashes. So you > really want: > > case $HOME in > *[^/]* ) HOME=${HOME%${HOME##*[^/]}} ;; > esac Actually, shortening ///

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 16:42, schrieb Eric Blake: On 03/13/2012 09:27 AM, Eric Blake wrote: Be aware that both approaches will misbehave if HOME is a root directory (/ or //), where you _don't_ want to strip trailing slashes. So you really want: case $HOME in *[^/]* ) HOME=${HOME%${HOME##*[^/]}} ;;

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 09:47 AM, dethrophes wrote: > Am 13.03.2012 16:42, schrieb Eric Blake: >> On 03/13/2012 09:27 AM, Eric Blake wrote: >>> Be aware that both approaches will misbehave if HOME is a root directory >>> (/ or //), where you _don't_ want to strip trailing slashes. So you >>> really want: >>

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 17:53, schrieb Eric Blake: On 03/13/2012 09:47 AM, dethrophes wrote: Am 13.03.2012 16:42, schrieb Eric Blake: On 03/13/2012 09:27 AM, Eric Blake wrote: Be aware that both approaches will misbehave if HOME is a root directory (/ or //), where you _don't_ want to strip trailing sla

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Andreas Schwab
dethrophes writes: > the missing "" in the case isn't redundant. > i.e. case "$HOME" in The word is not subject to word splitting and filename expansion, so there is no need to quote. Andreas. -- Andreas Schwab, sch...@linux-m68k.org GPG Key fingerprint = 58CA 54C7 6D53 942B 1756 01D3 44D5 2

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread dethrophes
Am 13.03.2012 18:13, schrieb Andreas Schwab: dethrophes writes: the missing "" in the case isn't redundant. i.e. case "$HOME" in The word is not subject to word splitting and filename expansion, so there is no need to quote. Andreas. Ok thanks for clarifying that.

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Eric Blake
On 03/13/2012 11:03 AM, dethrophes wrote: > > the missing "" in the case isn't redundant. It is too redundant; you only need "" after case if the parser would otherwise see two words before in. > case "$HOME" in >*[^/]* ) HOME=${HOME%${HOME##*[^/]}} ;; >/ | // ) ;; >*) HOME=/ ;; # //

Re: [bug] Home dir in PS1 not abbreviated to tilde

2012-03-13 Thread Yongzhi Pan
On Tue, Mar 13, 2012 at 8:58 PM, Chet Ramey wrote: > On 3/12/12 12:22 AM, Yongzhi Pan wrote: > > Tested in GNU bash, version 3.00.16(1)-release and 4.1.2(1)-release. > > > > Upon login, home dir is displayed as tilde in PS1: > > pan@BJ-APN-2 ~$ echo $PS1 > > \[\033[35m\]\u@\h \w$ \[\033[0m\] > >