On Sun, Sep 09, 2007 at 04:58:23PM +0200, Pierre-Philippe Coupard wrote:
[...]
>while [ 1 ];do
> echo Test1
> echo Test2 >> file.txt
> sleep 1
>done
>
>As expected, when this script is run in the background (&), the
> console
>slowly fills
On Sun, Sep 09, 2007 at 07:36:52PM +0200, Andreas Schwab wrote:
> Stephane Chazelas <[EMAIL PROTECTED]> writes:
>
> > Bonjour Pierre-Philippe,
> >
> > can be reproduced with 3.2.25 and with:
> >
> > bash -c 'trap "" PIPE; sleep 1; echo
On Sun, Sep 09, 2007 at 07:10:59PM +0100, Stephane Chazelas wrote:
[...]
> What OS and version of glibc? I do get the error message but I
> get both a and b in the file.
>
> That was on Linux, glibc 2.6.1.
[...]
Actually,
bash -c 'echo a; echo b > a' >&-
i
On Sun, Sep 09, 2007 at 08:44:25PM +0200, Pierre-Philippe Coupard wrote:
[...]
> - akula, my bleeding edge box, is a Debian-unstable box upgraded yesterday
> sept 8, 2007. It runs linux-2.6.17.7, libc6-2.6.1
>
> - kilo, my most up-to-date box where bash still seems to behave properly
> with regar
On Sun, Sep 09, 2007 at 10:08:14PM +0200, Andreas Schwab wrote:
> Stephane Chazelas <[EMAIL PROTECTED]> writes:
>
> > On Sun, Sep 09, 2007 at 07:10:59PM +0100, Stephane Chazelas wrote:
> > [...]
> >> What OS and version of glibc? I do get the error message but I
On Mon, Sep 10, 2007 at 12:05:57AM +0200, Aurelien Jarno wrote:
[...]
> >>> bash -c 'echo a; echo b > a' >&-
> >>>
> >>> is enough for me to reproduce the problem.
[both "a" and "b" seen in file "a".]
> >> Guess you have a buggy libc, then.
> > [...]
> >
> > I wouldn't be surprised if it has to
On Mon, Sep 10, 2007 at 11:56:33AM +0400, Dmitry Potapov wrote:
> On Sun, Sep 09, 2007 at 10:18:07PM +0100, Stephane Chazelas wrote:
> > Now, I'm not sure if we can say that the new glibc behavior
> > observed is bogus (other than it's different from the behavior
> &
On Mon, Sep 10, 2007 at 02:17:41PM +0400, Dmitry Potapov wrote:
[...]
> On Mon, Sep 10, 2007 at 09:08:33AM +0100, Stephane Chazelas wrote:
> > thanks for replying, I gave a list in another email. I tried on
> > Solaris 7 and HPUX and both seem to flush the buffer upon an
> >
On Mon, Sep 10, 2007 at 11:57:34AM -0400, Chet Ramey wrote:
> Andreas Schwab wrote:
> > Chet Ramey <[EMAIL PROTECTED]> writes:
> >
> >> What's needed is a portable interface like BSD's fpurge(3).
> >
> > This is also available from glibc as __fpurge (likewise on Solaris).
>
> Yes, though I have
On Mon, Sep 10, 2007 at 09:25:26PM +0400, Dmitry Potapov wrote:
[...]
> > With dietlibc:
> >
> > $ ./t
> > signal handler called, sig=2
> > writer: num_bytes=80008 num_lines=10001
> > writer: expected num_bytes=8 but was 80008
> > reader: num_bytes=80007 num_lines=1
> > reader: number of m
2007-09-12, 10:00(-07), chitti:
>
> I need to seperate the UDP and TCP ports from the /etc/services files.
> any pointers or help on scripting this in bash would be helpful
> thanks
awk '
NF == 0 || $1 ~ /^#/ {next}
$2 ~ /\/tcp$/ {print > "services.tcp"; next}
$2 ~ /\/udp$/ {print > "service
On Fri, Sep 21, 2007 at 05:16:03AM +0200, Jan Schampera wrote:
> Chet Ramey wrote:
>
>>> Description:
>>> there is missing a charachter when using the following:
>>> # TT="oo"; echo "l${TT:1}l"
>>> lol
>>> # TT="o"; echo "l${TT:1}l"
>>> l
>> I can't reproduce
On Wed, Sep 26, 2007 at 09:04:19PM -0400, Mike Frysinger wrote:
> is it even possible to utilize NUL in scripts ? or does bash just strip it
> out ? for example, trying to work with binary data:
> foo=$( echo "${foo}" > new-file
> the "new-file" will be exactly "binary-file" if all NUL bytes are
On Mon, Oct 01, 2007 at 04:43:15PM -0700, retiredff wrote:
>
> I have several functions in my /etc/profile (Mac OSX 10.4.9). I can use the
> functions at the commandline, however inside of scripts I receive an error.
> I'll use an example of a function I have called cecho that echo's a string
> in
On Tue, Oct 02, 2007 at 10:57:16AM -0600, Bob Proulx wrote:
> Stephane Chazelas wrote:
> > To work around that, you have to do things like this in
> > /etc/profile:
> > ...
> > And do something similar in your ~/.profile for your ~/.bashrc.
>
> While that is norm
On Tue, Oct 02, 2007 at 01:43:05PM -0600, Bob Proulx wrote:
[...]
> The AT&T ksh uses $ENV for the same purpose but does not automatically
> source a kshrc file. Therefore a very common configuration for the
> typical user in their profile is to set ENV=$HOME/.kshrc and use it
> for all of the sam
On Thu, Oct 04, 2007 at 11:33:17AM -0400, Rajeswar N wrote:
>Hi PAL,
>
> I am faced with a problem of running a huge list of steps through ksh /
> bash.
>
> IF for some reason task "n" fails, I am not able to re-start the script
> from the nth step.
>
> IS there a lable available in ksh?
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
On Mon, Oct 15, 2007 at 06:27:43PM -0400, Ken Failbus wrote:
> Hi Guys,
>
> When I specify on command-line "bash -n ". Bash doesn't
> check for valid syntax errors. E.g. if variable is missing a "$" infront
> of it while assigning a value. This is not catched by bash. Is there a
> more specific op
On Tue, Oct 30, 2007 at 06:58:10PM -0600, Eric Blake wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> According to Scott Moser on 10/30/2007 7:12 AM:
> > #= test.sh =
> > x=$(cat <<"EOF"
> > bad' syntax
> > EOF
> > )
>
> >
> > So, I'm not 100% certain what the "correct" behavi
On Thu, Nov 01, 2007 at 07:48:13AM -0700, Dan Nicolaescu wrote:
>
> In tcsh the command run-fg-editor bound by default to C-M-z is
> extremely useful when you have an editor suspended.
> It makes it very easy to return to the editor, do some editing, then
> suspend the editor again, and the comma
On Thu, Nov 01, 2007 at 08:01:58AM -0700, Dan Nicolaescu wrote:
>
> In tcsh %c can be used to only show the last few directory names in a
> path (also see the ellipsis variable).
>
> For example for this directory:
>
> /lib/modules/2.6.21-1.3194.fc7/kernel/drivers/char/hw_random/
>
> the pro
On Tue, Mar 18, 2008 at 01:11:35AM +0800, [EMAIL PROTECTED] wrote:
> On the man page at section "export", mention that the latter below
> will not do what one expects, as here revealed:
> $ set -x
> $ a=1 b=$a
> + a=1
> + b=1
> $ export x=1 y=$x
> + export x=1 y=
> + x=1
> + y=
> Yes I'm sure it is
On Fri, May 02, 2008 at 06:08:41AM +0800, [EMAIL PROTECTED] wrote:
> As http://bugs.debian.org/cgi-bin/bugreport.cgi?bug=476519 says, maybe
> it is a bash bug: with Debian sid's BASH_VERSION=3.2.33(1)-release
> about half the time the below works normally, the other half some
> magic hand sends "ex
On Fri, May 02, 2008 at 11:27:00PM +0800, [EMAIL PROTECTED] wrote:
> SC> Try
> SC> sudo env -i SHELLOPTS=xtrace su -p - nobody
> (I don't use sudo)
> uid=0(root) gid=0(root) groups=0(root)
> # env -i SHELLOPTS=xtrace su -p - nobody
> + PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> + '
On Fri, May 02, 2008 at 11:27:00PM +0800, [EMAIL PROTECTED] wrote:
> SC> Try
> SC> sudo env -i SHELLOPTS=xtrace su -p - nobody
> (I don't use sudo)
> uid=0(root) gid=0(root) groups=0(root)
> # env -i SHELLOPTS=xtrace su -p - nobody
> + PATH=/usr/local/bin:/usr/bin:/bin:/usr/bin/X11:/usr/games
> + '
On Sat, May 03, 2008 at 12:30:02AM +0800, [EMAIL PROTECTED] wrote:
> Here we see the typical deal. You asked me about ulimit.
[..]
Could you try ulimit -a?
Have you got a lot of processes running as "nobody"?
$ ps -fjlLunobody
$ sudo lsof -u nobody
Or maybe it could be "su" that exits and bash
On Sun, May 04, 2008 at 10:14:26AM +0800, [EMAIL PROTECTED] wrote:
[...]
> SC> Have you tried changing nobody's shell?
> I don't want to.
Then, can you try:
su - nobody -c ksh
su - nobody -c pdksh
su - nobody -c zsh
Also, what about:
perl -e '$<=$>=$(=$)=65534; exec sh'
perl -e '$<=$>=$(=$)=655
2008-05-06, 01:53(-04), Nathan Coulter:
> Looking for a simple ways to output the byte at which two strings differ.
> Here
> is one:
>
> cmp <(echo "hello") <(echo "help") | cut -d' ' -f5 | tr -d ,
>
> Any other suggestions?
I'd suggest you fix the locale to being C for more portable
results.
On Wed, May 07, 2008 at 05:50:59PM -0400, Chet Ramey wrote:
> Poor Yorick wrote:
>> ksh refuses to define functions which contain a dash ("-") in the name.
>> The
>> Bash manual also defines 'name' as consisting solely of letters, numbers,
>> and
>> underscores. So shouldn't bash refuse to crea
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
On Sun, May 11, 2008 at 12:37:12PM -0600, Bob Proulx wrote:
> Felix Schwarz wrote:
> > I'm not able to specify an interpreter in a shebang line if the path
> > to this interpreter contains spaces.
>
> That is correct. It is part of the implementation of the Berkeley #!
> exec(2) h
On Sun, May 11, 2008 at 02:01:29PM -0400, Paul Jarc wrote:
> Felix Schwarz <[EMAIL PROTECTED]> wrote:
> > I'm not able to specify an interpreter in a shebang line if the path
> > to this interpreter contains spaces.
>
> It's actually the kernel that interprets that line, not bash.
On Thu, Jun 05, 2008 at 06:31:36AM +0200, Jan Schampera wrote:
[...]
> The function definition is allowed in 3 forms:
> 1. NAME() ...
That's the Bourne and POSIX syntax
> 3. function NAME ...
That's the ksh syntax. It's probably only there for
compatibility with ksh (note
On Thu, Jun 05, 2008 at 10:07:51AM +0200, Andreas Schwab wrote:
> Stephane Chazelas <[EMAIL PROTECTED]> writes:
>
> > I suspect this:
> > $ sh -c 'function() { echo a; }; function'
> > sh: -c: line 0: syntax error near unexpected token `('
> >
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
On Fri, Jun 06, 2008 at 10:38:41AM +0200, Andreas Schwab wrote:
> Stephane Chazelas <[EMAIL PROTECTED]> writes:
>
> > The behavior is the same in ksh, but in ksh ${@:0:1} expands to
> > $0 which makes it more understandable ($0 has its meaning in
> > functions
On Thu, Jun 05, 2008 at 05:39:58PM +0100, Stephane Chazelas wrote:
[...]
> $ bash -c 'printf "%s\n" "${@:2}"' x 1 2 "3 4" 5
> 2
> 3 4
> 5
> $ bash -c 'IFS=a; printf "%s\n" "${@:2}"' 0 1 2 "3 4" 5
> 2
On Fri, Jun 06, 2008 at 11:08:23AM +0200, Andreas Schwab wrote:
> Stephane Chazelas <[EMAIL PROTECTED]> writes:
>
> > It still doesn't explain why ${@:1:1} expands to $1 and not $2
>
> For positional parameters indexing starts at 1.
[...]
Alright sorry, that was
Configuration Information [Automatically generated, do not change]:
Machine: i486
OS: linux-gnu
Compiler: gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i486'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i486-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='ba
On Tue, Jun 10, 2008 at 11:20:54AM +0200, Andreas Schwab wrote:
> [EMAIL PROTECTED] writes:
>
> > SUSv3> Some older implementations searched the current directory
> > SUSv3> for the file, even if the value of PATH disallowed it. This
> > SUSv3> behavior was omitted from this volume of IEEE Std
> >
On Tue, Jun 10, 2008 at 06:21:13AM -0600, Eric Blake wrote:
> -BEGIN PGP SIGNED MESSAGE-
> Hash: SHA1
>
> According to Andreas Schwab on 6/10/2008 3:20 AM:
> | [EMAIL PROTECTED] writes:
> |
> |> SUSv3> Some older implementations searched the current directory
> |> SUSv3> for the file, even
On Tue, Jun 10, 2008 at 11:19:47AM -0400, Chet Ramey wrote:
[...]
>> So it is indeed a bug.
>
> Yes, it is. I fixed it the last time this came up, in January.
[...]
Thanks,
It still seems to be there in 3.2.39 which seems to be the
latest version or ftp.gnu.org.
If there's a newer version, wher
On Tue, Jun 10, 2008 at 06:11:26PM -0700, stoyboy wrote:
>
> I am trying to create a script that will run continuously until the out of a
> command reaches a specific point.
> I have a command called showOutput and all it does it output the progress of
> running job, i want to create a script or a
On Fri, Jun 13, 2008 at 06:52:48PM -0400, Chet Ramey wrote:
[...]
>> Also, it may be good to specify that, if the timeout is
>> reached, bash will consume the input but will not put
>> that consumed input into the variable:
>
> Actually, the bash-4.0 implementation will put the input
On Sat, Jun 14, 2008 at 10:15:06PM -0400, Chet Ramey wrote:
> Stephane Chazelas wrote:
>
>> What about a different $? (like 2 for timeout)?
>
> That's reasonable. I'm thinking 128+SIGALRM.
[...]
That makes sense, but it's a bit of a pain to handle.
read -t 10
On Tue, Jul 08, 2008 at 08:44:47PM -0700, Mr Aras wrote:
[...]
> #!/bin/sh
> sh <<-EOF
> for word in hello world
> do
> echo word = $word
> done
> EOF
>
> output is:
> word =
> word =
>
>
> Can someone tell me why this doesn't work? I've been going nuts trying to
> figure this one out.
[
On Thu, Jul 17, 2008 at 11:12:47PM +, Poor Yorick wrote:
> To get rid of null elements in an array, I currently do something like this:
>
> bash-3.2$ var1=("with spaces" "more spaces" '' "the end")
> bash-3.2$ for v in "[EMAIL PROTECTED]"; do if test "$v"; then
> var2+=("$v"); fi; do
On Fri, Jul 18, 2008 at 08:52:47AM -0400, Poor Yorick wrote:
> Stephane Chazelas wrote:
>>
>> In zsh, removing the empty elements is just a matter of
>>
>> var1=($var1)
>
> Wouldn't this corrupt the elements with spaces, just as in bash?
[...]
No, zsh d
On Fri, Jul 25, 2008 at 08:58:21AM +0300, Pierre Gaston wrote:
[...]
> With "sh" (a posix shell) no
> In bash you can use the builtin "local" (or declare).
[...]
See http://stchaz.free.fr/locvar.sh for one way to implement
local scope in a POSIX script.
(those functions have not been thoroughly
2008-10-24, 14:56(+08), Clark J. Wang:
> In bash 3.0.14, the condition [[ file.txt =~ .*\\.txt\$ ]] returns TRUE but
> in 3.2.39 it returns FALSE. But with the shopt option `compat31' set it also
> returns TRUE. Is that reasonable? In the bash manual, `compat31' makes sense
> only for quoted patter
On Mon, Oct 27, 2008 at 11:12:24PM +0100, Ralf Wildenhues wrote:
[...]
> --- foo.sh ---
> #! /bin/sh
>
> do_work ()
> {
> sleep 1
> echo "work $i is done"
> }
>
> for i in 1 2 3 4 5 6 7 8 9 10
> do
> (
> do_work $i
> ) &
> done
> wait
>
> --- bar.sh ---
> #! /bin/sh
>
> ./foo.sh > s
On Tue, Oct 28, 2008 at 10:51:13PM +0100, Ralf Wildenhues wrote:
[...]
> > : > stdout > stderr
[...]
> Yes. For shell portability, I'll write the first line as
> : > stdout
> : > stderr
>
> though.
Why?
I can't see why ": > stdout > stderr" wouldn't work in any
shell. It should even work in
On Sat, Nov 01, 2008 at 11:21:01PM -, Sven Mascheck wrote:
[...]
> : > stdout > stderr
[...]
> > It fails on old Ultrix sh, which can't redirect the same fd more than once
> > in a single statement. But that platform is relatively dead these days.
>
> More detailed:
>
> - It actually w
On Tue, Nov 18, 2008 at 07:09:19PM +, Dan wrote:
[...]
> Questions:
> 1) Does my guide (see below) for applying the patches make sense? I
> couldn't see any other way to make this work without creating the symbolic
> links and using the -p0 option as recommended by Chet. The steps in the
> g
On Wed, Nov 26, 2008 at 01:25:17PM -0500, Chet Ramey wrote:
> [EMAIL PROTECTED] wrote:
> > Gentlemen, I have discovered a documentation oversight. In the manual,
> > we see:
> > set -u --
> > : $@ $*
> > : $1
> >
> > and
> >
> > set --
> > : ${*?} [EMAIL PROTECTED]
> > : ${1?}
> >
> > Therefore
On Thu, Dec 04, 2008 at 10:16:20AM +0100, Roman Rakus wrote:
> probably you heard about this topic. It is invoked by ubuntu guys. See
> https://launchpad.net/ubuntu/+spec/command-not-found-magic
> I would like to know, what do you think about it. It needs a small change
> in bash.
[...]
A note a
On Tue, Dec 09, 2008 at 09:14:51AM -0500, Chet Ramey wrote:
> >
> > Hello i would like to pass an array to my script command line argument, but
> > only the first element of the array is displayed. Here is my process :
> >
> > script1:
> > my_array=(el1 el2 el3)
> > script2 -f $my_array
>
> You
On Sat, Dec 13, 2008 at 09:30:27AM +0100, Andreas Schwab wrote:
> "S. Sevki Dincer" writes:
>
> > i want to start building a project with ./configure --prefix=... $(myflags)
> > where myflags is an executable text file on my path. myflags has the
> > following in it:
> > printf 'CFLAGS="-O2 -fomi
2009-01-21, 02:48(+01), Sebastian Kapfer:
> Am Montag, den 19.01.2009, 10:14 -0800 schrieb Alex Reed:
>> Should the globstar (**) syntax allow for partial parameter matching
>> (i.e. **.c to find all *.c files in the current directory and its sub-
>> directories)?
>>
>> Currently this can be imple
2009-01-21, 22:49(-05), Chet Ramey:
> Stephane CHAZELAS wrote:
>
>> Apparently, just like ksh93, bash4 only implements ** and not ***
>> nor the globbing qualifiers, but like zsh it requires **/*.c
>> (**.c won't work).
>
> I'm not sure what version of ks
On Mon, Jan 26, 2009 at 07:13:32AM +0100, Jan Schampera wrote:
> Hi.
>
> In comp.unix.shell [1] somebody wondered about
> IFS=: read a b <<< a:b; echo "'$a' '$b'"
> ending up in
> 'a b' ''
>
> Korn and Z seem to behave different. I see that across all my available
> Bash versions. I remember
2009-02-3, 19:38(+00), Simos:
[...]
> I have been using tcsh for a long time and I plan to move to bash.
[...]
I'd recommend moving to zsh instead. The transition is easier
from tcsh and this way to won't have to move from bash to zsh
later on.
--
Stéphane
2009-02-3, 22:07(+00), Simos:
> On Tue, Feb 3, 2009 at 9:24 PM, Stephane CHAZELAS
> wrote:
>> 2009-02-3, 19:38(+00), Simos:
>> [...]
>>> I have been using tcsh for a long time and I plan to move to bash.
>> [...]
>>
>> I'd recommend moving to zsh
2009-02-4, 10:50(-08), Alex Reed:
> Can someone please explain how 'mapfile' should be used? I am trying:
>
> cat file.txt | mapfile
> for i in ${MAPFILE};do echo $i; done
>
> and I see no output.
mapfile would be run in a subshell.
Try mapfile < file.txt
Note that the for loop syntax above is
2009-02-4, 19:59(+00), Stephane CHAZELAS:
[...]
> Also, it looks like it should guard against
> seq 5 | mapfile -C echo -c0
>
> That command above cannot be interrupted with
[...]
Note that that minor bug is still in 4.0-release.
I still don't get the rationale behind that b
2009-03-9, 05:03(-07), simonm:
> Hi all,
>
> Here's a quick one...
>
> The following works as expected:
>
> # exec 9<>test.file ; jot 50 >&9 ; tail -5 <&9 9>&-
> 46
> 47
> 48
> 49
> 50
That must be a bug in your tail implementation. That output
should only happen if test.file already contains tho
2009-03-10, 01:54(-07), simonm:
[...]
> cat very_large_text_file | a | long | and | complex | chain | of |
> pipes | tee <(command_one) <(command_two) 1>/dev/null
>
> So, I want to apply command_one and command_two to the whole output of
> the resulting text stream coming from "pipes".
>
> Is there
2009-03-12, 06:47(-07), ipif:
[...]
> sh-3.2# bash
> bash: command_substitute: cannot duplicate pipe as fd 1: Bad file descriptor
>
> (currently I'm using bash as init)
[...]
> In my opinion this problem might not be bash related, but I have no idea
> what goes wrong. Unfortunately gdb seems to rel
2009-03-10, 15:43(-04), Chet Ramey:
>> What are the valid charactes for the IFS variable? In particular, is '\0' a
>> valid one?
>
> Technically, yes, but in practice it's not useful. There are too many things
> represented as C strings to make NUL work right.
[...]
And to answer the rest of th
2009-03-16, 09:53(+01), Dave B:
> Stephane CHAZELAS wrote:
>
>> 2009-03-10, 15:43(-04), Chet Ramey:
>>>> What are the valid charactes for the IFS variable? In particular, is '\0'
>>>> a
>>>> valid one?
>>> Technically, ye
2009-03-26, 21:22(-04), Chet Ramey:
> Chris F.A. Johnson wrote:
>
>>Chet, how about an option to mapfile that strips leading and/or
>>trailing spaces?
>>
>>Another useful option would be to remove newlines.
>
> I'm disinclined to add one, since it's easy enough to use the
> ${line##[
2009-04-2, 12:33(-04), Chris F.A. Johnson:
> On Thu, 2 Apr 2009, Mike Coleman wrote:
>
>> [Oops--I sent that incomplete.]
>>
>> It would be nice if there was some really brief syntax for
>>
>>$(type -p somecommand)
>>
>> I find myself using this all day long with 'ls', 'file', 'ldd',
>> 'string
2009-04-8, 08:35(-04), Chet Ramey:
>> Configuration Information [Automatically generated, do not change]:
>> Machine: hppa2.0
>> OS: hpux10.20
>> Compiler: /net/appl/gcc-3.3/bin/gcc
>> Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='hppa2.0'
>> -DCONF_OSTYPE='hpux10.20' -DCONF_MACHTYPE='hpp
2009-04-09, 23:18(+02), Mart Frauenlob:
[...]
> I wonder where's the bug report?
> You seem to miss that the support place for bash is 'gnu.bash' not
> 'gnu.bash.bug'.
[...]
Interesting, I can see that Google groups has a gnu.bash
newsgroup with messages that date back as far as 1999
newsgroup. I
2009-06-26, 13:58(+02), Christian Krause:
> Hi Chet,
>
> Thanks for the answers. The problem is now, that this behavior of the
> bash creates some real problems outside, probably with a larger impact.
> Before asking the kernel developers to change parts of linux kernel's
> build system, I'd like t
2009-06-28, 00:02(-07), Steve Ward:
> The comma character (',') is in function sh_backslash_quote but not in
> function sh_contains_shell_metas.
>
> Is comma a metacharacter?
[...]
Only is some special constructions:
$ echo {a}
{a}
$ echo {a,b}
a b
$ echo {a\,b}
{a,b}
--
Stéphane
2009-06-28, 15:40(-04), Chet Ramey:
> Linda Walsh wrote:
>> I thought I remembered a 'bgnice' value under the 'set' or shopt
>> options It doesn't seem to be in my current bash. Was that
>> only a ksh-ism?
>
> It's only in ksh. I don't think it's that great an idea. It's not
> on the list o
2009-06-29, 10:03(-04), Chet Ramey:
>
>> and it's a bug that bash-4 is filtering them.
>
> Maybe, maybe not. That's open to interpretation. Here's how I see it.
>
>> not allowing them to be used in
>> the shell is fine (echo ${vmlinux.lds}), but removing them from the
>> environment and thus no
2009-07-17, 13:09(-06), Eric Blake:
>
> According to Huang Tao on 7/17/2009 9:46 AM:
>> I'm not sure whether it is a bug
>> how can i echo the text string "-e" barely ( or "-n", "-E")
>> i tried
>> $echo "-e"
>> $echo '-e'
>> and some other inputs, all of which produced no outputs.
>
> Instead of u
2009-07-17, 22:02(-04), Chris F.A. Johnson:
>
> $ printf -v q[2] "%s" "$RANDOM"
> bash: printf: `q[2]': not a valid identifier
>
>
> I know I can work around it with a temporary variable, but it
> would be nice if it could be done in a single step.
[...]
Just do a "touch q2" before and t
2009-07-19 21:07:20 -0400, Chet Ramey:
[...]
> > Note that it's a known non POSIX-conformance of bash.
> >
> > POSIX is explicit that
> >
> > echo -e
> >
> > Should output "-e\n".
>
> That's why bash has the `xpg_echo' option. You can build bash in such
> a way that it's always enabled.
[...]
2009-10-25, 12:05(-07), Linda Walsh:
> This is not exactly bash specific, but I was looking at a shell script
> recently and they use the age old convention of using upper case
> names for all their shell variables.
[...]
By convention, _environment_ variables are upper-case, which helps
in a sh
2009-10-27, 16:29(-04), Jim Lawson:
[...]
> I have a user we're trying to encourage to migrate from tcsh to bash,
> who is used to his shell starting up in overwrite mode (as opposed to
> the default Insert mode.)
>
> Long story short, while I can easily bind a key to the "overwrite-mode"
> readlin
2009-10-28 09:00:59 -0400, Chet Ramey:
> > zle-line-init() zle overwrite-mode
> > zle -N zle-line-init
> >
> > To get back on topic, bash is the only Bourne-like shell that I
> > know that doesn't allow that function definition syntax above,
> > I've always wondered why.
>
> The Posix grammar has
2009-10-28 09:46:49 -0400, Chet Ramey:
[...]
> >> The Posix grammar has never allowed it (a `function_body' must be a
> >> compound command, and that's what bash implements), and there has
> >> never been sufficient demand to add it as an extension.
> > [...]
> >
> > It's never allowed it to POSI
2009-10-28 11:06:09 -0400, Chris F.A. Johnson:
> On Wed, 28 Oct 2009, Greg Wooledge wrote:
>
> > On Wed, Oct 28, 2009 at 02:00:53PM +0000, Stephane CHAZELAS wrote:
> > > I can understand it. I was more curious about the origins. After
> > > all, that breaks Bourn
2009-10-28, 20:28(-04), Dave Rutherford:
[...]
> Add to .Xdefaults: XTerm*answerbackString: ^[[2~
> Add to .bashrc (and .profile if it doesn't source .bashrc):
> bind '"^[[2~": overwrite-mode'
> PROMPT_COMMAND='echo -n ^E'
[...]
Along those lines, you could use the TIOCSTI ioctl. That woul
2009-10-29, 07:23(+00), Stephane CHAZELAS:
> 2009-10-28, 20:28(-04), Dave Rutherford:
> [...]
>> Add to .Xdefaults: XTerm*answerbackString: ^[[2~
>> Add to .bashrc (and .profile if it doesn't source .bashrc):
>> bind '"^[[2~": overw
2009-12-07, 22:22(+00), pk:
> phani krishna jampala wrote:
>
>> bash is not capable of comparing of strings ( imean interms of lessthan or
>> greater than etc)
>
> It is, if you use [[ ]]
>
> a="abcd"
> b="bcde"
> if [[ "$b" > "$a" ]]; then
> echo "$b is greater than $a"
> fi
[...]
Or the "["
2009-12-11, 16:16(+00), Marc Herbert:
> Sven Mascheck a écrit :
>> Chris F.A. Johnson wrote:
>>
>>> This has been discussed more than once in c.u.s; check the
>>> archives.
>>
>> and that's why we better discuss it here now?
>
> I think Chris' message was more like: "let's not discuss it at all a
2009-12-12, 10:21(+00), Stephane CHAZELAS:
[...]
>> exists()
>> {
>> [ -e "$1" -o -L "$1" ]
>> }
>
> $ exists =
> bash: [: too many arguments
>
> [ -e "$1" ] -o [ -L "$1" ]
[...]
Sorry, I meant
[ -e "$1" ] || [ -L "$1" ]
--
Stéphane
2009-12-12, 11:28(+01), Bernd Eggink:
> Am 10.12.2009 10:40, schrieb konsolebox:
>
>> I hope the development team will also consider adding a way in bash to
>> declare global variables inside a function perhaps either with an
>> option in typeset or declare like -g (same as zsh) and/or a builtin
>>
2009-12-11, 06:17(-07), Eric Blake:
>
> According to Roman Rakus on 12/11/2009 6:08 AM:
>> kill builtin incorrectly thinks that -PGID is signal name even if the
>> signal name is set by -s or -n option.
>>
>> [rra...@dhcp-lab-170 ~]$ kill -s TERM -5032
>> bash: kill: 5032: invalid signal specifica
2009-12-12, 12:37(-05), Chet Ramey:
> On 12/12/09 5:24 AM, Bernd Eggink wrote:
>
>> It's the other way round. Regarding typeset and declare, the man page
>> says: " When used in a function, makes each name local, as with the
>> local command. " So within a function, typeset, declare, and local are
2010-01-03, 17:23(-05), Chet Ramey:
[...]
>> da...@thinkpad ~ $ cd foo
[...]
>> da...@thinkpad ~/foo $ mv ~/foo ~/bar
[...]
>> da...@thinkpad ~/foo $ echo $PWD
>> /home/darkk/foo
>> da...@thinkpad ~/foo $ pwd
>> /home/darkk/foo
>> da...@thinkpad ~/foo $ /bin/pwd
>> /home/darkk/bar
[...]
> It's not
2010-01-05 20:23:39 +0100, Andreas Schwab:
> Greg Wooledge writes:
>
> > On Mon, Jan 04, 2010 at 01:25:50PM +0000, Stephane CHAZELAS wrote:
> >> >> da...@thinkpad ~/foo $ echo $PWD
> >> >> /home/darkk/foo
> >
> >> Well, if I read
>
2010-01-05 16:40:50 -0500, Chet Ramey:
> > Well, if I read
> > http://www.opengroup.org/onlinepubs/9699919799/utilities/pwd.html
> > correctly, bash pwd should output /home/darkk/bar in that case
> > as $PWD does *not* contain an absolute path to the current
> > directory.
>
> Bash notices this wh
2010-01-9, 06:23(-06), den...@netstrata.com:
[...]
> This produces the correct distribution of dice values for two six-sided dice:
>
> $ unset dice; for i in {1..1}; do ((dice[$RANDOM%6+1 + $RANDOM%6+1]++));
> done; echo "${di...@]}"
> 290 582 837 1130 1375 1635 1315 1126 845 574 291
>
> The
101 - 200 of 414 matches
Mail list logo