Check out my photos on Facebook

2009-09-02 Thread Mahaveer Darade
Hi bug-bash@gnu.org,

I set up a Facebook profile where I can post my pictures, videos and events and 
I want to add you as a friend so you can see it. First, you need to join 
Facebook! Once you join, you can also create your own profile.

Thanks,
Mahaveer

To sign up for Facebook, follow the link below:
http://www.facebook.com/p.php?i=593931832k=5VFUZ66XWT6G6BD1QAY5Y4SQSr


bug-bash@gnu.org was invited to join Facebook by Mahaveer Darade. If you do not 
wish to receive this type of email from Facebook in the future, please click on 
the link below to unsubscribe.
http://www.facebook.com/o.php?k=8a15b2u=10036289220mid=1088df7G5af312a3fac4G0G8
Facebook's offices are located at 1601 S. California Ave., Palo Alto, CA 94304.



printf does not always display warning messages on write errors

2009-09-02 Thread Stefano Lattarini
Hi everybody.

I found the following bug while running some of my bash scripts on 
GNU/Linux with stdout redirected to /dev/full, to see if write errors
where correctly detected and reported.

It turned out that, on write errors, the printf builtin correctly
returns a non-zero status (thus my scripts at least had a correct
exit status), but unfortunately it does not always display a suitable
error message on stderr; in particular, it fails to do so if the
printed  string does *not* end with a newline. On the contrary, the
echo builtin both returns a non-zero status and write a clear error
message on standard error, even if called with the `-n' option (so
that the printed string does not end with a newline).

Examples (tested with both bash 3.2 and bash 4.0, more details about 
versions and system information will follow):

  $ ls -l /dev/full
  crw-rw-rw- 1 root root 1, 7 Sep  2 18:36 /dev/full
  
  $ cat printf-bug.sh
  echo * `type printf`
  echo * `type echo`
  # - - -
  printf x /dev/full
echo a:$?
  printf %s\n x /dev/full
echo b:$?
  echo -n x /dev/full
echo c:$?
  echo x /dev/full
echo d:$?
  # - - -
  exit 0
  
  $ bash printf-bug.sh # using either bash 4.0 or 3.2
  * printf is a shell builtin
  * echo is a shell builtin
  a:1
  printf-bug.sh: line 6: printf: write error: No space left on device
  b:1
  printf-bug.sh: line 8: echo: write error: No space left on device
  c:1
  printf-bug.sh: line 10: echo: write error: No space left on device
  d:1

By the way, bash 3.0 behaves far worser (I don't known if you can
found this info useful, but anyway here it is):

  $ bash-3.0 printf-bug.sh
  * printf is a shell builtin
  * echo is a shell builtin
  a:0
  b:0
  c:1
  d:1

Here are the details on my system and the bash shells used.

 ---

Details on operating system:

 $ uname -s -r -m -o
 Linux  2.6.26-1-686  i686  GNU/Linux
 $ lsb_release -i -d -r -c
 Distributor ID: Debian
 Description:  Debian GNU/Linux testing/unstable
 Release:  testing/unstable
 Codename:  n/a
 $ cat /etc/debian_version
 squeeze/sid

 ---

Details on bash versions:

Bash 4.0
---
 Installed from debian package bash, version 4.0-4
 Complete version string:  4.0.28(1)-release
 
Information from bashbug [Automatically generated]:
  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='bash' 
-DSHELL 
-DHAVE_CONFIG_H
-I. -I../bash -I../bash/include -I../bash/lib
-g -O2 -Wall
  Machine Type: i486-pc-linux-gnu

Bash Version: 4.0
Patch Level: 28
Release Status: release

Bash 3.2
---
 Installed by hand from official tarball.
 Complete version string: 3.2.0(1)-release

Information from bashbug [Automatically generated]:
  Machine: i686
  OS: linux-gnu
  Compiler: gcc
  Compilation CFLAGS:
-DPROGRAM='bash'
-DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu'
-DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc'
-DLOCALEDIR='/opt/vintage/bash-3.2/share/locale'
-DPACKAGE='bash'
-DSHELL
-DHAVE_CONFIG_H
-I. -I. -I./include -I./lib
-g -O2
  Machine Type: i686-pc-linux-gnu

Bash Version: 3.2
Patch Level: 0
Release Status: release

Bash 3.0
---
 Installed by hand from official tarball.
 Complete version string: 3.00.0(1)-release

Information from bashbug [Automatically generated]:
  Machine: i686
  OS: linux-gnu
  Compiler: gcc
  Compilation CFLAGS:
-DPROGRAM='bash'
-DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu'
-DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc'
-DLOCALEDIR='/opt/vintage/bash-3.0/share/locale'
-DPACKAGE='bash'
-DSHELL
-DHAVE_CONFIG_H
-I. -I. -I./include -I./lib
-g -O2
  Machine Type: i686-pc-linux-gnu

Bash Version: 3.0
Patch Level: 0
Release Status: release

 ---

Regards,
   Stefano




ulimit and ssh?

2009-09-02 Thread peter360

Can someone explain this to me?  Why am I not seeing correct results from
ulimit after ssh into localhost?  Thanks!

$ ssh localhost bash -c 'ulimit -a'
unlimited

but

$ bash -c 'ulimit -a'
core file size  (blocks, -c) 0
data seg size   (kbytes, -d) unlimited
scheduling priority (-e) 0
file size   (blocks, -f) unlimited
pending signals (-i) 32768
max locked memory   (kbytes, -l) 32
max memory size (kbytes, -m) unlimited
open files  (-n) 1024
pipe size(512 bytes, -p) 8
POSIX message queues (bytes, -q) 819200
real-time priority  (-r) 0
stack size  (kbytes, -s) 10240
cpu time   (seconds, -t) unlimited
max user processes  (-u) 1024
virtual memory  (kbytes, -v) unlimited
file locks  (-x) unlimited

-- 
View this message in context: 
http://www.nabble.com/ulimit-and-ssh--tp25262471p25262471.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Re: ulimit and ssh?

2009-09-02 Thread Bob Proulx
peter360 wrote:
 Can someone explain this to me?  Why am I not seeing correct results from
 ulimit after ssh into localhost?  Thanks!
 
 $ ssh localhost bash -c 'ulimit -a'
 unlimited

You have insufficiently quoted your argument to ssh.  This is causing
bash not to get ulimit -a but to get ulimit -a instead.  You are
seeing the output of ulimit.

Try this:

  ssh localhost bash -c 'ulimit -a'

And this:

  echo ulimit -a | ssh localhost bash

Bob




Re: ulimit and ssh?

2009-09-02 Thread peter360

Bob,

Thanks for the quick reply!   A local unix guru also told me the same thing.

So, just to make sure I really understand this, here is how I understand ssh
worked: even thought I gave the command bash -c 'ulimit -a' as 3 separate
strings, ssh (either the client or the server) actually concatenate them
into one, and sshd forks a shell to parse the concatenated command string,
in this case bash -c ulimit -a.Correct me if I am wrong.

Glad I learned something new.




Bob Proulx wrote:
 
 peter360 wrote:
 Can someone explain this to me?  Why am I not seeing correct results from
 ulimit after ssh into localhost?  Thanks!
 
 $ ssh localhost bash -c 'ulimit -a'
 unlimited
 
 You have insufficiently quoted your argument to ssh.  This is causing
 bash not to get ulimit -a but to get ulimit -a instead.  You are
 seeing the output of ulimit.
 
 Try this:
 
   ssh localhost bash -c 'ulimit -a'
 
 And this:
 
   echo ulimit -a | ssh localhost bash
 
 Bob
 
 
 
 

-- 
View this message in context: 
http://www.nabble.com/ulimit-and-ssh--tp25262471p25263766.html
Sent from the Gnu - Bash mailing list archive at Nabble.com.





Re: ulimit and ssh?

2009-09-02 Thread Bob Proulx
peter360 wrote:
 So, just to make sure I really understand this, here is how I understand ssh
 worked: even thought I gave the command bash -c 'ulimit -a' as 3 separate
 strings,

Yes.

 ssh (either the client or the server) actually concatenate them into
 one,

No.  It isn't put into one string unless you quote it as one string.

 and sshd forks a shell to parse the concatenated command string,
 in this case bash -c ulimit -a.Correct me if I am wrong.

On the remote server a $SHELL (specified in /etc/passwd, not
necessarly the same shell as on the client machine, a long standing
issue with rsh/ssh) parses the arguments /again/.  Which means you
almost always need two layers of quoting if quoting is needed.  One
for the local shell.  One more for the remote shell.

echo ulimit -a | ssh localhost bash

This style avoids the quoting problem entirely and guarentees that the
remote shell is bash regardless of different /etc/passwd
configuration.  However it does use stdin and it is no longer
available for the remote command, if that is important.  Useful when
it can be used however.

Also, my example had a problem.

ssh localhost bash -c 'ulimit -a'

I should have added the -n option to ssh so that it wouldn't read from
stdin.  In the above if used in a script it will read and consume any
input that may have been expected for a different command.

  ssh -n localhost bash -c 'ulimit -a'

Bob




Re: printf does not always display warning messages on write errors

2009-09-02 Thread Chet Ramey
Stefano Lattarini wrote:
 Hi everybody.
 
 I found the following bug while running some of my bash scripts on 
 GNU/Linux with stdout redirected to /dev/full, to see if write errors
 where correctly detected and reported.
 
 It turned out that, on write errors, the printf builtin correctly
 returns a non-zero status (thus my scripts at least had a correct
 exit status), but unfortunately it does not always display a suitable
 error message on stderr; in particular, it fails to do so if the
 printed  string does *not* end with a newline. 

Thanks for the report.  This will be fixed in the next version.

Chet
-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/




RE: Who handles fails to build problems for bash?

2009-09-02 Thread Tovrea, George W (US SSA)
Tried adding each of -lcurses and -lncurses with the following results:

/home/users/tovrea/local/sgi6/bin/gcc -L./builtins -L./lib/readline 
-L./lib/readline -L./lib/glob -L./lib/tilde  -L./lib/sh 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0/32 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/lib32 
-L/home/users/tovrea/local/sgi6/lib-g -O2 -o bash shell.o eval.o y.tab.o 
general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o 
copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o 
mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o 
alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o bashline.o  list.o 
stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o 
xmalloc.o  -lbuiltins -lsh -lreadline -lhistory -ltermcap -lcurses -lglob 
-ltilde  lib/intl/libintl.a   -ldl 
/home/users/tovrea/local/sgi6/bin/ld: non-dynamic relocations refer to dynamic 
symbol PC
/home/users/tovrea/local/sgi6/bin/ld: failed to set dynamic section sizes: Bad 
value
collect2: ld returned 1 exit status

/home/users/tovrea/local/sgi6/bin/gcc -L./builtins -L./lib/readline 
-L./lib/readline -L./lib/glob -L./lib/tilde  -L./lib/sh 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0/32 
-L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/lib32 
-L/home/users/tovrea/local/sgi6/lib-g -O2 -o bash shell.o eval.o y.tab.o 
general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o 
copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o 
mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o 
alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o bashline.o  list.o 
stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o 
xmalloc.o  -lbuiltins -lsh -lreadline -lhistory -ltermcap -lncurses -lglob 
-ltilde  lib/intl/libintl.a   -ldl 
/home/users/tovrea/local/sgi6/bin/ld: cannot find -lncurses
collect2: ld returned 1 exit status 

I also tried configuring with --with-curses but had the same result. I also 
took a look at config.log. It indicates it cannot find termcap.h but does find 
libtermcap (there is one located at /usr/lib). Didn't see any other problems.

-Original Message-
From: Chet Ramey [mailto:c...@caleb.ins.cwru.edu] On Behalf Of Chet Ramey
Sent: Tuesday, September 01, 2009 2:52 PM
To: Tovrea, George W (US SSA)
Cc: bug-bash@gnu.org; c...@po.cwru.edu
Subject: Re: Who handles fails to build problems for bash?

 Could not find any groups other than this for bash problems. My build is 
 failing with 
 
 make[1]: Leaving directory `/home/users/tovrea/BASH/build_sgi_bash/lib/tilde'
 rm -f bash
 /home/users/tovrea/local/sgi6/bin/gcc -L./builtins -L./lib/readline 
 -L./lib/readline -L./lib/glob -L./lib/tilde  -L./lib/sh 
 -L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0 
 -L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/4.3.0/32 
 -L/home/users/tovrea/local/sgi6/lib/gcc/mips-sgi-irix6.5/lib32 
 -L/home/users/tovrea/local/sgi6/lib-g -O2 -o bash shell.o eval.o y.tab.o 
 general.o make_cmd.o print_cmd.o  dispose_cmd.o execute_cmd.o variables.o 
 copy_cmd.o error.o expr.o flags.o jobs.o subst.o hashcmd.o hashlib.o 
 mailcheck.o trap.o input.o unwind_prot.o pathexp.o sig.o test.o version.o 
 alias.o array.o arrayfunc.o braces.o bracecomp.o bashhist.o bashline.o  
 list.o stringlib.o locale.o findcmd.o redir.o pcomplete.o pcomplib.o syntax.o 
 xmalloc.o  -lbuiltins -lsh -lreadline -lhistory -ltermcap -lglob -ltilde  
 lib/intl/libintl.a   -ldl 
 /home/users/tovrea/local/sgi6/bin/ld: non-dynamic relocations refer to 
 dynamic symbol PC
 /home/users/tovrea/local/sgi6/bin/ld: failed to set dynamic section sizes: 
 Bad value
 collect2: ld returned 1 exit status
 make: *** [bash] Error 1

The quick fix should be adding -lcurses or -lncurses (whatever works) as the
value of TERMCAP_LIB in the= Makefile.

The longer fix is to look at config.log and try and figure out why there is
(apparently) no library that contains the termcap functions, and why the
build process is not defaulting to the built-in termcap library if so.

Chet

-- 
``The lyf so short, the craft so long to lerne.'' - Chaucer
 ``Ars longa, vita brevis'' - Hippocrates
Chet Ramey, ITS, CWRUc...@case.eduhttp://cnswww.cns.cwru.edu/~chet/