Re: Creating directories with sticky bit set

2009-03-12 Thread Ian Kelling
Angel Tsankov wrote: > Greg Wooledge wrote: > Let's say that removing '-p' is straightforward, but what about setting the > sticky bit to every newly created directory component? > mkdir also has the -m argument, so you could do mkdir -m 1755 dir interestingly -m does not apply to parent directo

new-style command substitution generates syntax error near ')'

2009-03-12 Thread esumbar
Configuration Information [Automatically generated, do not change]: Machine: amd64 OS: freebsd7.1 Compiler: cc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='amd64' -DCONF_OSTYPE='freebsd7.1' -DCONF_MACHTYPE='amd64-portbld-freebsd7.1' -DCONF_VENDOR='portbld' -DLOCALEDIR='/usr/local/share/

Problem with returning to bash from another program

2009-03-12 Thread Cameron Pulsford
I am running bash 4.0.10 (installed through macports) hw = Macbook 2,1 os = mac os x 10.5.6 Compiled with gcc 4.0.1 A lot of times after a long vim session when I return to bash, my cursor is not on a new line, it's on a previous line and it seems like bash is in overtype mode. So whatever I

Re: Creating directories with sticky bit set

2009-03-12 Thread smallnow
Angel Tsankov wrote: Greg Wooledge wrote: Let's say that removing '-p' is straightforward, but what about setting the sticky bit to every newly created directory component? mkdir also has the -m argument, so you could do mkdir -m 1755 dir interestingly -m does not apply to parent directories

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > On Thu, 12 Mar 2009 16:17:45 -0400 > Chet Ramey wrote: > > [snip] > > It is now believed that the problem has to do with Yacc on FreeBSD. > There is an experimental patch just issued that substitutes 'bison' for > 'yacc'. It is being tested right now by some users. Bash-4.0 pars

Re: EOF disowns background jobs?

2009-03-12 Thread Chet Ramey
Sven Mascheck wrote: > On Wed, Mar 11, 2009 at 10:11:22PM -0400, Chet Ramey wrote: > >>> (bash exits, leaving some-command running) > >> How could you run daemons from the command line otherwise? > > I'm curious, what do you mean with daemons here? Essentially any command you'd like to leave ru

Re: EOF disowns background jobs?

2009-03-12 Thread Sven Mascheck
On Wed, Mar 11, 2009 at 10:11:22PM -0400, Chet Ramey wrote: >> (bash exits, leaving some-command running) > How could you run daemons from the command line otherwise? I'm curious, what do you mean with daemons here? I'd expect real daemons to detach from the terminal and create a new session /

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
On Thu, 12 Mar 2009 16:17:45 -0400 Chet Ramey wrote: [snip] It is now believed that the problem has to do with Yacc on FreeBSD. There is an experimental patch just issued that substitutes 'bison' for 'yacc'. It is being tested right now by some users. I can supply you a copy of the FreeBSD Make

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > Fair enough. I know that several users of FreeBSD are complaining all > ready and have switched back to Bash-3.x. > > This is a short script, named "t.sh" that will produce the error > message: > > #!/usr/bin/env bash > > if $(which gpg2); then >printf "gpg2 located" > fi >

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
On Thu, 12 Mar 2009 16:17:45 -0400 Chet Ramey wrote: >Gerard wrote: >> I just installed Bash-4 via the FreeBSD ports system. The >> installation went fine. However, all of my Bash scripts that use the >> $() syntax now fail with this error message: >> >> syntax error near unexpected ')' > >This

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
Greg Wooledge wrote: > On Thu, Mar 12, 2009 at 04:13:12PM -0400, Chet Ramey wrote: > $ echo >&2 |& wc -l > >> I wonder if I should modify it so the implicit 2>&1 happens first, right >> after the pipe, so any user-specified redirections can override it. That >> doesn't seem that radical a cha

Re: EOF disowns background jobs?

2009-03-12 Thread Chet Ramey
Matthew Woehlke wrote: > Chet Ramey wrote: >> Matthew Woehlke wrote: >>> $ some-command & >>> $ ^D >>> (bash exits, leaving some-command running) >>> >>> Is this what is supposed to happen? Just asking because it made me go >>> "huh?"; I was expecting some-command to get SIGHUP'd. >> >> Yes, that's

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 04:13:12PM -0400, Chet Ramey wrote: > > >> $ echo >&2 |& wc -l > I wonder if I should modify it so the implicit 2>&1 happens first, right > after the pipe, so any user-specified redirections can override it. That > doesn't seem that radical a change. Opinions? (I know wh

Re: Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Chet Ramey
Gerard wrote: > I just installed Bash-4 via the FreeBSD ports system. The installation > went fine. However, all of my Bash scripts that use the $() > syntax now fail with this error message: > > syntax error near unexpected ')' This isn't useful at all without an example I can use to reproduce t

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
> Greg Wooledge writes: > > > On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: > >> Still does not fix this case: > >> > >> $ echo >&2 |& wc -l > >> > >> 0 > > > > That looks like the correct output to me. When setting up a pipeline > > with redirections, the pipeline happens fi

Bash-4 breaks $() syntax on FreeBSD

2009-03-12 Thread Gerard
I just installed Bash-4 via the FreeBSD ports system. The installation went fine. However, all of my Bash scripts that use the $() syntax now fail with this error message: syntax error near unexpected ')' I have modified some of the scripts to use the older "`" tic method; however, that is not re

Re: Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
Greg Wooledge wrote: > If you only ever create directories from interactive shells with > the "mkdir" command, you could override it with a function: > > mkdir() { > command mkdir "$@" && > chmod +t "$@" > } > > (In reality you'd want to process function arguments, and remove for > example a "-p"

Re: new redirection operator seems broken

2009-03-12 Thread Andreas Schwab
Greg Wooledge writes: > On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: >> Still does not fix this case: >> >> $ echo >&2 |& wc -l >> >> 0 > > That looks like the correct output to me. When setting up a pipeline > with redirections, the pipeline happens first. > > The manual s

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 05:21:04PM +0100, Andreas Schwab wrote: > Still does not fix this case: > > $ echo >&2 |& wc -l > > 0 That looks like the correct output to me. When setting up a pipeline with redirections, the pipeline happens first. The manual says your example should be equivalent to

Re: new redirection operator seems broken

2009-03-12 Thread Andreas Schwab
Chet Ramey writes: >> On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: >> >rm 2>&1 | grep --color op >> >rm |& grep --color op >> > >> >Notice that they are behaving differently. >> >> Confirmed in 4.0.0 and 4.0.10: > > Interesting. Only for n

Re: EOF disowns background jobs?

2009-03-12 Thread Matthew Woehlke
Chet Ramey wrote: Matthew Woehlke wrote: $ some-command & $ ^D (bash exits, leaving some-command running) Is this what is supposed to happen? Just asking because it made me go "huh?"; I was expecting some-command to get SIGHUP'd. Yes, that's what's supposed to happen. How could you run daemo

Re: new redirection operator seems broken

2009-03-12 Thread Chet Ramey
> On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: > > rm 2>&1 | grep --color op > > rm |& grep --color op > > > > Notice that they are behaving differently. > > Confirmed in 4.0.0 and 4.0.10: Interesting. Only for non-builtin simple commands a

bash: command_substitute: cannot duplicate pipe as fd 1: Bad file descriptor

2009-03-12 Thread ipif
Hi, I'm currently trying to get Linux working on an embedded sparc processor (leon3, sparc V8). But every time I try to run an instance of bash the following error occurs: sh-3.2# bash bash: command_substitute: cannot duplicate pipe as fd 1: Bad file descriptor (currently I'm using bash as in

Re: loop through records

2009-03-12 Thread Duane Schweitzer
Thanks Chris, this was very helpful. I come from an oracle background and I'm trying to transfer some of that into bash... Duane On Wed, Mar 11, 2009 at 3:44 PM, Chris F.A. Johnson wrote: > On Wed, 11 Mar 2009, OnTheEdge wrote: > > >> All, I'm trying to figure out how to loop through an array of

Re: Creating directories with sticky bit set

2009-03-12 Thread Greg Wooledge
On Thu, Mar 12, 2009 at 09:50:49AM +0200, Angel Tsankov wrote: > What can I do so that every directory I create has the sticky bit set? If you only ever create directories from interactive shells with the "mkdir" command, you could override it with a function: mkdir() { command mkdir "$@" &&

Re: new redirection operator seems broken

2009-03-12 Thread Greg Wooledge
On Wed, Mar 11, 2009 at 09:50:18PM -0400, m...@ice.filescope.com wrote: > rm 2>&1 | grep --color op > rm |& grep --color op > > Notice that they are behaving differently. Confirmed in 4.0.0 and 4.0.10: imadev:~$ rm 2>&1 | tr '[:lower:]' '[:upper:]' USAGE: RM [-R

Creating directories with sticky bit set

2009-03-12 Thread Angel Tsankov
Hello, What can I do so that every directory I create has the sticky bit set? Regards, Angel Tsankov