Re: leading 0 inconsistence?

2011-02-14 Thread Greg Wooledge
On Sat, Feb 12, 2011 at 11:57:08AM +0100, Ralf Goertz wrote: > > if [ $((i)) -lt 9 ] ; then echo ok; fi > bash: 08: value too great for base (error token is "08") > > Why is 08 not tried to be interpreted as octal when *numerically* compared > using test? s/not // in your question, I assume. Bec

Re: PS1 has ruined line wrap

2011-02-14 Thread Greg Wooledge
On Sat, Feb 12, 2011 at 02:53:31PM -0500, Jonathan Reed wrote: > An old thread but I found a way around this by adding a line to my bashrc: > > echo -ne "\033]0; `whoami` @ `hostname` \007" ~/.bashrc is only sourced at the beginning of each interactive non-login shell (and, one hopes, also from y

Re: leading 0 inconsistence?

2011-02-14 Thread Ralf Goertz
Greg Wooledge wrote: > On Sat, Feb 12, 2011 at 11:57:08AM +0100, Ralf Goertz wrote: >> > if [ $((i)) -lt 9 ] ; then echo ok; fi >> bash: 08: value too great for base (error token is "08") >> >> Why is 08 not tried to be interpreted as octal when *numerically* compared >> using test? > > s/not //

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Greg Wooledge
On Sun, Feb 13, 2011 at 08:17:05PM -0700, Bob Proulx wrote: >_CRed=$(tput setaf 1) #Red >_CRST=$(tput sgr0) #Reset >_CBLD=$(tput bold) #Bold >_prompt_open="" >_prompt_close="" >_prompt=">" >[[ $UID -eq 0 ]] && { >_prompt_open="$_CBLD$_CRed" >_prompt_

Re: PS1 has ruined line wrap

2011-02-14 Thread Chet Ramey
On 2/12/11 2:53 PM, Jonathan Reed wrote: > An old thread but I found a way around this by adding a line to my bashrc: > > echo -ne "\033]0; `whoami` @ `hostname` \007" > > The reference > http://mdinh.wordpress.com/2010/11/21/xterm-title-bar/ > > On Thu, Nov 25, 2010 at 7:26 PM, Chet Ramey

compat31

2011-02-14 Thread Dennis Williamson
I'm having a discussion with someone who claims that for them on Bash 4.0.33, with compat31 *off*, they are getting 3.1 behavior with quoted patterns in a =~ match. They're saying that this: [[ a =~ "." ]] && echo match || echo no results in "match". I cannot reproduce this without doing shopt

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Bob Proulx
Greg Wooledge wrote: > red=$(tput setaf 1) bold=$(tput bold) reset=$(tput sgr0) > PS1='\[$red\]\h\[$reset\]:\[$bold\]\w\[$reset\]\$ ' > > I tested that. It works. Nicely cleaned up! > PS1='\h:\w\$ ' For what it is worth I use something similar: PS1='\u@\h:\w\$ ' Bob

Re: Here strings and pathname expansion

2011-02-14 Thread Roman Rakus
On 02/14/2011 06:43 AM, Jan Schampera wrote: Hello world, I recently answered a question about using the asterisk mixed with redirection and other words. This also lead me to the documentation that states (REDIRECTION section): --- The word following the redirection operator in the fol

Re: PS1 has ruined line wrap

2011-02-14 Thread Jonathan Reed
> > around all the characters that don't move the cursor portion immediately after the $PWD Thanks for the clarity guys. It took me a few minutes to see the matching []'s and to escape the correct ones. My syntax highlighting was confusing me but I think my enemy is that I'm trying to use the [

bash 4.2, parameter expansion problem

2011-02-14 Thread Juergen Daubert
Hello, I stumbled over the following while trying to build xterm from sources with bash 4.2: $:~> /bin/sh --version | head -n1 GNU bash, version 4.2.0(1)-release (i686-pc-linux-gnu) $:~> /bin/sh sh-4.2$ a="${b:-'/foo/bar'}" sh: bad substitution: no closing `}' in ${b:-'/foo/bar'} sh-4.2$ a

Re: bash 4.2, parameter expansion problem

2011-02-14 Thread Eric Blake
On 02/14/2011 10:51 AM, Juergen Daubert wrote: > Hello, > > I stumbled over the following while trying to build xterm from sources > with bash 4.2: > > $:~> /bin/sh --version | head -n1 > GNU bash, version 4.2.0(1)-release (i686-pc-linux-gnu) > $:~> /bin/sh > sh-4.2$ a="${b:-'/foo/bar'}" >

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Linda Walsh
Bob Proulx wrote: Linda Walsh wrote: But anyway, something else is is awry. Now my root prompt, instead of being red, looks like: "\[\033[1m\]\[\033[31m\]Ishtar:root#\[\033[0m\] " ;-/ That will be due to incorrect quoting. Which suggestion did you implement? There were several. What v

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Linda Walsh
For completeness current code (haven't fixed the DISPLAY part yet): if [ -n "$_sh_interactive_shell" ] ; then shopt -s cdspell checkhash checkwinsize cmdhist dotglob extglob shopt -s histappend hostcomplete lithist shopt -s no_empty_cmd_completion xpg_echo # build a prompt #

Re: how to workaroun 'nl' being added: Working now! Tnx!

2011-02-14 Thread Linda Walsh
Ah...Caught the addition of the _prompt var as separate. It works now: if [ -n "$_sh_interactive_shell" ] ; then shopt -s cdspell checkhash checkwinsize cmdhist dotglob extglob shopt -s histappend hostcomplete lithist shopt -s no_empty_cmd_completion xpg_echo # build a promp

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Dennis Williamson
On Mon, Feb 14, 2011 at 12:34 PM, Linda Walsh wrote: > > For completeness current code (haven't fixed the DISPLAY part yet): > > if [ -n "$_sh_interactive_shell" ] ; then       shopt -s cdspell checkhash > checkwinsize cmdhist dotglob extglob         shopt -s histappend > hostcomplete lithist >  

Re: Here strings and pathname expansion

2011-02-14 Thread Jan Schampera
Roman Rakus wrote: It is noted in Here Documents (and Here Strings is a variant of here documents). And there is: No parameter expansion, command substitution, arithmetic expansion, or pathname expansion is performed on word. This is not true for here strings (infact, it wouldn't make sense

Re: how to workaroun 'nl' being added to input-line after 49 characters....

2011-02-14 Thread Linda Walsh
Dennis Williamson wrote: On Mon, Feb 14, 2011 at 12:34 PM, Linda Walsh wrote: (My 'PUBLIC's are short for: alias PUB_CONST="typeset -xr" alias PUBLIC="typeset -x" � � � ##aka EXPORT Why not just do export _prompt_open="" Except that it's not likely that those variables need to be exporte

Re: compat31

2011-02-14 Thread Dennis Williamson
On Mon, Feb 14, 2011 at 9:14 AM, Greg Wooledge wrote: > On Mon, Feb 14, 2011 at 09:03:34AM -0600, Dennis Williamson wrote: >> I'm having a discussion with someone who claims that for them on Bash >> 4.0.33, with compat31 *off*, they are getting 3.1 behavior with quoted >> patterns in a =~ match. >

Bash-4.2 available for FTP

2011-02-14 Thread Chet Ramey
Introduction The first public release of bash-4.2 is now available with the URLs ftp://ftp.cwru.edu/pub/bash/bash-4.2.tar.gz ftp://ftp.gnu.org/pub/gnu/bash/bash-4.2.tar.gz and from the usual GNU mirror sites. This tar file includes the formatted documentation (postscript, dvi, html

Readline-6.2 available for FTP

2011-02-14 Thread Chet Ramey
The first public release of the GNU Readline library, version 6.2, is now available for FTP with the URLs ftp://ftp.cwru.edu/pub/bash/readline-6.2.tar.gz ftp://ftp.gnu.org/pub/gnu/readline/readline-6.2.tar.gz and from the usual GNU mirror sites. This distribution is essentially a standalone vers