[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
cat.sh issue
From: |
Matt |
Subject: |
cat.sh issue |
Date: |
Tue, 24 Mar 2009 23:20:14 -0400 (EDT) |
Configuration Information [Automatically generated, do not change]:
Machine: i686
OS: linux-gnu
Compiler: i686-pc-linux-gnu-gcc
Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='i686'
-DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='i686-pc-linux-gnu'
-DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL
-DHAVE_CONFIG_H -I. -I. -I./include -I./lib
-DDEFAULT_PATH_VALUE='/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin'
-DSTANDARD_UTILS_PATH='/bin:/usr/bin:/sbin:/usr/sbin'
-DSYS_BASHRC='/etc/bash/bashrc' -DSYS_BASH_LOGOUT='/etc/bash/bash_logout'
-DNON_INTERACTIVE_LOGIN_SHELLS -DSSH_SOURCE_BASHRC -march=pentium4 -O2 -pipe
uname output: Linux ice.filescope.com 2.6.25.10 #5 PREEMPT Thu Nov 27 16:10:07
EST 2008 i686 Intel(R) Pentium(R) 4 CPU 1400MHz GenuineIntel GNU/Linux
Machine Type: i686-pc-linux-gnu
Bash Version: 4.0
Patch Level: 10
Release Status: release
Description:
This is a combination bug report and a question.
The bug is in the examples/scripts/cat.sh demo script. There are cases where
the script will break.
The culprit line is:
echo "$REPLY"
It should instead be:
printf %s\\n "$REPLY"
In the current state of the script, lines like "-n" or "-ennnn" won't get
printed.
The question I have is why couldn't echo have a -- flag? Is it for POSIX or
some other kind of compatibility reasons? Is there any easier way to accomplish
what I want other than printf %s\\n "$var"?
--Matt