On Mon, May 04, 2009 at 12:34:19AM +0800, jida...@jidanni.org wrote:
> Maybe mention in the man page at
>[...] Matches any one of the enclosed characters...
> that one will need to backslash at least any spaces used inside it:
> $ ls [^ ]
> ls: cannot access [^: No such file or directory
On Wed, May 06, 2009 at 04:03:51PM +0200, Roman Rakus wrote:
> On 05/06/2009 02:14 PM, cseguino wrote:
> > $ find . | xargs grep -v "No such file or directory" | grep "StateRB"
> > grep:
> >./Tiger/codebase/netmarkets/jsp/ext/eurocopter/tiger/change/.svn/text-base/Copy:
> >No such file or
On Wed, May 06, 2009 at 04:53:27PM -0700, J. Greg Davidson wrote:
> What's the best way to update a variable indirectly, e.g. when its name is
> passed to an update function?
http://mywiki.wooledge.org/BashFAQ/006
On Mon, May 11, 2009 at 10:35:18AM +1000, Jon Seymour wrote:
> I am trying to parse untrusted strings and represent in a form that
> would be safe to execute.
printf "%q"
> cmd="echo"
> for a in "$@"
> do
> cmd="$cmd '${a/\'/''}'"
> done
> echo "$cmd"
> eval "$cmd"
http://mywiki.wooledge.org
On Wed, May 20, 2009 at 12:34:42PM -0700, jjjaime wrote:
> FUNCTION_1 &
> FUNCTION_2
> FUNCTION_3
>
> So, to speed up the execution of the script, I want FUNCTION_1 and
> FUNCTION_2 in parallel. But the script fails when FUNCTION_2 ends before
> FUNCTION_1.
Why?
> Is there any mechanism for sync
On Wed, May 27, 2009 at 03:33:10AM -0700, straygrey wrote:
> Please tell me what is wrong with the following line that I have in a bash
> script:-
> [code]
> TODAYDATE=`date +"%Y%m%d"`
> declare -a FiLeS=( $TODAYDATE.TeleformDB.tar.bz2
> $TODAYDATE.TeleformDB2.tar.bz2 )
> [/code]
> When I run it I
On Thu, May 28, 2009 at 12:58:10PM -0700, Linda Walsh wrote:
> operator caused a failure in matching. I.e.:
> if [[ "$Var"=~"+([:digit:])" ]] ; then ...
> worked.
No, this is incorrect. You need spaces around the =~ so that it's parsed
as three separate things, rather than one thing. Your
On Fri, Jun 05, 2009 at 08:35:15AM -0700, Francis Moreau wrote:
> unset foo[0]
This is a problem in your script, unfortunately. Even without nullglob,
this can still fail if you happen to have a file named foo0 in your
current working directory, which would be matched as a glob.
For total safety
On Fri, Jun 19, 2009 at 11:05:27AM -0700, bitozoid wrote:
> > edua...@ceo ~ $ printf "%02d\n" 8
> > -bash: printf: 8: invalid number
> Sorry, not a bug, but octal representation. Really sorry.
Others will make the same mistake (it's very common), so for the
benefit of peop
On Mon, Jun 29, 2009 at 12:45:29AM +0200, Marc Weber wrote:
> > echo `expr $var - 1`
> I think that this is bad. expr should do some calculation. If the
> calculation fails (eg devision by zero) the return value should be non
> zero.
You'd think so, but alas, the people who made expr(1) had a diff
On Tue, Jun 30, 2009 at 09:58:45PM +0200, Marc Weber wrote:
> How is this done?
>
> CHK0="test $? == 0"
> my_important_task; $CHK0 || exit 1
You'd need single quotes instead of double there. (And == is illegal in
Bourne/POSIX shell test commands; only bash tolerates it.) You could
also use a fu
On Fri, Jul 03, 2009 at 01:01:47PM -0400, Chris F.A. Johnson wrote:
> NL=$'\n'
> string="This is a$NLmulti-line$NLstring"
Of course you would need curly braces for that.
NL=$'\n'
string="This is a${NL}multi-line${NL}string"
On Tue, Jul 07, 2009 at 08:16:50PM +0200, Christopher Roy Bratusek wrote:
> unsource: the opposite of source (while source is making functions
> publically available, unsource would remove them)
You can "unset -f" a function. You could source a script-file that
contains a bunch of "unset -f foo"
> > # Usage: exchange varname1 varname2
> > exchange() {
> >local tmp
> >[[ $1 = *[^[:alnum:]_]* || $1 = [0-9]* ]] &&
> > { echo "Naughty naughty" >&2; return 1; }
> >[[ $2 = *[^[:alnum:]_]* || $2 = [0-9]* ]] &&
> > { echo "Naughty naughty" >&2; return 1; }
> >eval tmp=\$$
On Fri, Jul 17, 2009 at 06:42:03PM -0400, Chris Jones wrote:
> Sometimes I wonder if Greg is a "real" person.. not a smart program that
> can generate the correct answers to all the questions you had about bash
> utilization - and may have been too shy to ask.
Either I'm
On Fri, Jul 17, 2009 at 02:53:21PM -0700, Erik Olof Wahlstrom wrote:
> #!/bin/bash
> BACKUP_DIR="/media/disk/AUTOMATED_BACKUPS/DB_DAILY"
>
> CURRENT_DIR=$BACKUP_DIR/`date +%d`
# See how you call date here without an explicit path? That's good.
> DATABASES="$(/usr/bin/mysql -uUsername -pPasswo
On Thu, Jul 23, 2009 at 09:59:48AM -0400, Justin Williams wrote:
> Unfortunately, if I try to strace it (strace time ls), I get command not
> found.
''strace time ls'' will try to run the external command ''time'' which
apparently you haven't got installed. (Which is probably good in this
case, a
On Sat, Aug 01, 2009 at 07:36:36PM +0200, Aljosha Papsch wrote:
> ModManager() {
> ClearFiles -4
> echo "zenity --list --window-icon=\"${run_path}icon.png\"
> --width=\"650\" --height=\"350\" --title=\"${modmanager[${lang}]}\"
> --text=\"${RegMods[${lang}]}:\" --column=\"${no[${lang}]}\"
> --c
On Tue, Aug 04, 2009 at 08:23:16AM -0700, John Reiser wrote:
> On 08/04/2009 12:48 AM, fam...@icdsoft.com wrote:
> > The problem is that Bash does not read up the whole script which it
> > is currently executing.
> > As a result of this, if we update the script file with a newer
> >
On Thu, Aug 13, 2009 at 02:45:51AM -0400, Mike Frysinger wrote:
> i dont think word expansion occurs first, otherwise wouldnt this break:
> foo() {
> unset b c
> f="a b="
> local a=$f c=
As I understand it, this is what happens:
1) The parser separates out the tokens that consti
On Tue, Aug 25, 2009 at 02:40:24PM +0200, Oskar Hermansson wrote:
> wget
> http://www.kohanaphp.com/download?modules%5Bauth%5D=Auth&vendors%5Bmarkdown%5D=Markdown&languages%5Ben_US%5D=en_US&format=zip
>
> If the command is placed in a file instead, the file is successfully
> downloaded:
>
On Wed, Aug 26, 2009 at 02:45:39AM -0700, Linda Walsh wrote:
> I was scripting and fixing some permissions in Win,
> and had a var 'c' set to (no quotes in the var): 'C\windows\system32'
How did you assign this value? Did you read it from a file? Did you
type a specific bash command?
> # ech
On Wed, Aug 26, 2009 at 04:36:42PM +0300, Pierre Gaston wrote:
> Thanks, I agree with that, I'm sorry I should have been more explicit,
> what was not clear to me was where this special role of the \ is explained,
> Because if you use literals [[ something = \* ]] is the same as [[
> something = "
On Wed, Aug 26, 2009 at 03:04:16PM -0400, Sam Steingold wrote:
> foo=`ls`
> echo $foo
echo "$foo"
On Thu, Aug 27, 2009 at 06:13:38AM -0700, Arenstar wrote:
> temp="mysqldump -h $DBSource -u $USER -p$PASS $DB $TABLE --where='$Field
> > $VarStart AND $Field < $VarEnd' > $TABLE$DumpName"
> exec $temp
The obvious problem here is that you want the last ">" to be treated as
a redirection op
On Fri, Aug 28, 2009 at 07:06:52AM -0700, Arenstar wrote:
> What effects can eval have? that i am unaware of. In fact ive never used
> eval before, it just wasnt neccessary..
> Thank you for your interesting reply
>
> query="mysqldump -h $DBSource -u rx -p $DB $TABLE --where '$Field >
> $
On Tue, Sep 08, 2009 at 11:39:02AM -0700, peter360 wrote:
> Thanks for the explanation. So my understanding of the way ssh works is
> still incorrect. I am confused about at which point the two parameters,
> "-c" and "ulimit -a" were converted into three, "-c", "ulimit", and "-a". I
> guess I n
On Thu, Sep 24, 2009 at 03:05:07PM -0700, Mathias Dahl wrote:
> I did not find any generic way to quote/escape file names so I
> hardcoded some chars I know exist in my file names and used sed:
printf %q "$filename"
will either insert backslashes in front of all the shell metacharacters,
or $'...
On Thu, Oct 01, 2009 at 04:17:33PM +0200, Martin von Gagern wrote:
> #!/bin/bash
>
> shopt -s extglob
> f() {
> if [[ $v == a@(a|b|c)c ]]; then
> case $v in
> a@(a|b|c)c)
You're using extglobs inside a function, and extglob wa
On Mon, Oct 05, 2009 at 07:55:33PM +0200, clemens fischer wrote:
> >> {
> >> ... a number of commands
> >> } 2>&1 | ${prog_log} "${logfile}"
> yeah ok, but the commands really are not executed. I have an option
> dry-run in the script, which sets "prog_log=true". Then there are
> a bun
On Tue, Oct 06, 2009 at 03:25:31AM -0400, Mike Frysinger wrote:
> On Tuesday 06 October 2009 01:39:56 Mikel Ward wrote:
> > It would be more obvious if it had a paragraph directly below
> > ${parameter} saying something like:
> >
> >${!name}
> >Indirect expansion. name is expanded
On Wed, Oct 07, 2009 at 08:07:19PM +1030, Lyall Pearce wrote:
> Description:
> Cannot form expressions which involve left or right brackets.
Parentheses?
> Repeat-By:
>
> basePic="(2008-04)"
> if [ "${basePic:0:1}" = '(' -a "${basePic:4:1}" = ')' ]
> then
> echo "Got
On Wed, Oct 14, 2009 at 12:24:30PM -0600, Bob Proulx wrote:
> Pierre Gaston wrote:
> > Please consider asking in a sed mailing list like:
> > http://sed.sourceforge.net/#mailing
> > or maybe in the usenet group comp.unix.shell
>
> I would think help-gnu-ut...@gnu.org would be the better place to a
On Thu, Oct 22, 2009 at 06:47:43PM +, K??rlis Repsons wrote:
> I've set up a system, which has some disks, that are not always used, but are
> always mounted. OS and program files are all in other place and the only
> program, which still reads some blocks (echo 1 > /proc/sys/vm/block_dump),
On Wed, Oct 28, 2009 at 06:04:00AM -0400, Gerard wrote:
> COM_LINE="-u${SQL_USER} -p${SQL_PASSWORD} -h ${HOST} ${NO_COLUMN_NAME}"
> table=MyTable
> DECLARE_STATEMENTS=($(mysql ${COM_LINE} -i -e"use ${DB}; SELECT defaults FROM
> "${table}" WHERE 1;"))
You're populating an array with each word (not
On Wed, Oct 28, 2009 at 02:00:53PM +, Stephane CHAZELAS wrote:
> I can understand it. I was more curious about the origins. After
> all, that breaks Bourne backward compatibility (in a shell
> called Bourne-again shell)
Bourne shell has no functions at all.
> Has there be historical versions
On Thu, Oct 29, 2009 at 11:49:11AM -0400, Gerard wrote:
> Are you sure? Using: IFS=$(echo) seems to set IFS to a newline here.
imadev:~$ IFS=$(echo)
imadev:~$ printf "%s" "$IFS" | od -t x1
000
imadev:~$ printf "\n" | od -t x1
000a
001
imadev:~$ echo ${#IFS}
0
imadev:~$ unset IFS
A
On Tue, Nov 03, 2009 at 05:37:45PM -0700, Bob Proulx wrote:
> Dobromir Romankiewicz wrote:
> > bash: 0008: value too great for base (error token is "0008").
> Numbers with leading zeros are read as octal constants. Octal is
> composed of '0' through '7'. The number '8' is too large to be an
> oc
On Mon, Nov 09, 2009 at 08:39:57AM +0200, Ciprian Dorin, Craciun wrote:
> But then how can I solve the problem? (How about `()` which
> clearly is a new shell instance.)
The problem being "how to use set -e in a consistent manner across all
shells"? You can't. set -e is unpredictable, unreli
On Mon, Nov 09, 2009 at 03:49:09PM +0200, Ciprian Dorin, Craciun wrote:
> Unfortunately I'm not subscribed to this mailing list. Could you
> point me to the right thread?
http://lists.gnu.org/archive/html/bug-bash/2009-11/threads.html
And... pretty much every month, especially since bash 4 ch
make[1]: Entering directory `/var/tmp/bash-4.0/lib/glob'
rm -f glob.o
/net/appl/gcc-3.3/bin/gcc -c -DHAVE_CONFIG_H -DSHELL -I. -I../.. -I../..
-I../../include -I../../lib -DHPUX -g -O2 glob.c
glob.c:1026:69: missing terminating ' character
make[1]: *** [glob.o] Error 1
make[1]: Leaving directory
/net/appl/gcc-3.3/bin/gcc -L./builtins -L./lib/readline -L./lib/readline
-L./lib/glob -L./lib/tilde -L./lib/malloc -L./lib/sh-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 hashcm
The other two messages I sent today were just things I encountered while
bringing my bash 4.0 up to the current patch level. This is the real
problem I've been chasing.
imadev:/var/tmp/bash-4.0$ bash-3.1.17 -c 'printf -v foo %s bar'
imadev:/var/tmp/bash-4.0$ bash-4.0.10 -c 'printf -v foo bar'
ima
On Wed, Nov 11, 2009 at 09:41:29PM -0500, Chet Ramey wrote:
> If your version of vsnprintf doesn't behave like that, I claim it's a
> bug. The Posix and C standards explicitly allow the buffer to be NULL
> if the size argument is 0, and guarantee that no data will be written
> in this case.
Thank
On Thu, Nov 12, 2009 at 02:37:58PM -0500, Chet Ramey wrote:
> I try to write to the current (well, ten-year-old) standards. The
> replacement in lib/sh/snprintf.c behaves as C99 specifies; you might try
> using it by #undefing HAVE_VSNPRINTF and HAVE_SNPRINTF in config.h.
Ah, wonderful. I wasted
On Wed, Nov 18, 2009 at 06:54:01PM -0800, Sergei Steshenko wrote:
> My script was applying patches from 'bash-4.0-patches' directory, not from
> 'bash-4.0' one, and maybe this was my mistake.
Yes. You should always be in the source directory you're patching,
when you apply a patch. The only ques
On Thu, Nov 19, 2009 at 06:32:49PM +0100, Joachim Schmitz wrote:
> In siglist.c the compiler complained bitterly about having to convert the
> reseult of _() into a char * (sometimes comming from int, somtimes coming
> from const char *) My nasty workaround:
The correct fix for that one is to #i
On Sun, Nov 22, 2009 at 06:14:56PM +0800, wrote:
> run the command "drcomd" ,successful!
>
> but run command "sudo drcomd" ,return "sudo : drcomd: command not found"
Not really a bash bug.
> under both (fedora)the PATH is
> /usr/kerberos/sbin:/usr/kerberos/bin:/usr/local/bin:/usr/bin:/bin:/
> On 25 Nov 2009, at 08:19, Antonio Macchi wrote:
> > Hi, I'm using older bash 3.2.39, so please forgiveme if in your newer bash
> > this issue does not arise.
On Wed, Nov 25, 2009 at 08:25:00AM +0100, Maarten Billemont wrote:
> As for NUL out outputting anything in your result, the cause is C-st
On Wed, Nov 25, 2009 at 02:35:51PM +0100, Antonio Macchi wrote:
> it sounds strange, beacuse
>
> $ find . -print0 | while read -d $'\x00'; do touch "$REPLY"; done
>
> works fine.
>
>
> but if I try to "output" $'\x00', I can't.
There's a lot going on here, so I'll try to cover it as best I can
On Mon, Nov 30, 2009 at 11:46:03AM +0100, Lhunath (Maarten B.) wrote:
> Don't use pipelines to send streams to read. Use file redirection instead:
>
> Instead of ''command | read var''
> Use ''read var < <(command)''
>
> I hardly see a need to change the existing implementation.
Or for the orig
On Sat, Nov 28, 2009 at 02:57:45PM +0100, Antonio Macchi wrote:
> but, if you don't have hd (hexdump) how can you see the content of a,
> for example, strange file
>
> i mean
>
> $ ls -l
> total 0
> -rw-r--r-- 1 user1 user1 0 2009-11-28 14:56 ?
>
> $ hd <(ls)
> 09 0a
On Sat, Nov 28, 2009 at 02:18:37PM +0100, Antonio Macchi wrote:
> $ hd <(echo -en \\0{0..3}{0..7}{0..7})
As for this, I wonder if you understand how bash handles this.
I know it certainly wasn't obvious to me! Due to the way the parsing
is done, the brace expansions inside the proces substitution
On Mon, Nov 30, 2009 at 11:15:38AM -0500, Mike Frysinger wrote:
> On Monday 30 November 2009 06:12:35 Gerard wrote:
> > I need to know if " $(< " also works on Bash < 4.
>
> it's been around for pretty much all time. bash-2 had it for sure, and that
> is ancient.
It doesn't exist in bash 1.14.7
On Mon, Nov 30, 2009 at 04:21:33PM +, Marc Herbert wrote:
> Chris F.A. Johnson a écrit :
> >Why should it be the last element of a pipeline that is executed in
> >the current shell and not the first?
>
> Because that's POSIX' choice?
Because that's what Korn shell does. (But not pdks
On Mon, Nov 30, 2009 at 12:35:32PM -0500, Mike Frysinger wrote:
> On Monday 30 November 2009 12:12:17 Greg Wooledge wrote:
> > On Mon, Nov 30, 2009 at 11:15:38AM -0500, Mike Frysinger wrote:
> > > On Monday 30 November 2009 06:12:35 Gerard wrote:
> > > > I need to
> pjodrr wrote:
> > how can I prefix every line of output of some command with a
> > timestamp?
Mark Herbert wrote:
> What is wrong with the following:
>
> prefix_with_date ()
> {
> while read; do
> printf '%s: %s\n' "$(date)" "$REPLY";
> done
> }
>
> seq 4 | prefix_with_date
On Mon, Dec 07, 2009 at 05:08:02PM -0800, DennisW wrote:
> Since printf understands floats (or acts like it does), you can use it
> plus a little care and luck to do float comparisons in Bash:
> [...]
> $ printf -v a "%08.2f" $a
> $ printf -v b "%08.2f" $b
> $ [[ $a < $b ]] && echo true || echo fal
On Tue, Dec 08, 2009 at 02:01:23PM +0100, ma...@fiz15.jupiter.vein.hu wrote:
> $ echo $(echo "'alfa beta'")
> 'alfa beta'
>
> Instead of 'alfa beta' with double space.
echo "$(echo "'alfa beta'")"
On Thu, Dec 10, 2009 at 05:31:20PM +, Marc Herbert wrote:
> Does anyone know a more elegant way to check for file existence?
> Something that does not fork a subshell. And is also more readable
> maybe. And is obviously not much longer.
shopt -s nullglob
files=(*)
if (( ${#files[*]} == 0 )); t
On Thu, Dec 10, 2009 at 05:37:04PM -0200, Matias A. Fonzo wrote:
> Maybe you want the Chris F.A Johnson's implementation [1]:
>
> set -- "/tmp/emptydir"/*
> [[ -f $1 ]] && echo non-empty || echo empty;
>
> References:
> [1]
> http://www.issociate.de/board/goto/866027/checking_if_a_directory_is_e
On Fri, Dec 11, 2009 at 01:09:09PM +0100, Antonio Macchi wrote:
>
> this could be another way to accomplish this
>
> empty_dir() {
> eval test \" $1/* \" == \"" $1/* "\";
> }
>
> (excluding invisible files...)
This one also has the problem of failing if the directory contains a
single file n
On Fri, Dec 11, 2009 at 04:16:13PM +, Marc Herbert wrote:
> In case anyone is interested my winner (so far) is:
>
> exists()
> {
> [ -e "$1" -o -L "$1" ]
> }
>
> if exists foo/*; then
> for f in foo/*; do
> ...
> done
> fi
What if there's a subdirectory or something and you'd lik
On Tue, Dec 22, 2009 at 08:46:14AM -0500, Chet Ramey wrote:
> The first release candidate of bash-4.1 is now available with the URL
>
> ftp://ftp.cwru.edu/pub/bash/bash-4.1-rc1.tar.gz
The syslog feature (in config-top.h) appears to be enabled by default.
This is quite shocking
On Tue, Dec 22, 2009 at 02:23:47PM -0500, Mike Frysinger wrote:
> On Tuesday 22 December 2009 08:46:14 Chet Ramey wrote:
> > The first release candidate of bash-4.1 is now available with the URL
>
> top level Makefile.in is missing pathnames.h dependency info for
> builtins/evalstring.o and built
On Fri, Dec 25, 2009 at 05:28:43PM -0800, Julius Davies wrote:
> This file in the source contains a BSD license with an advertising clause:
>
> bash-4.0/examples/loadables/getconf.c
>
>
> I'm curious if this is a problem, since Bash is mostly GPL version 3 (or
> later).
The examples/loadables/
On Mon, Jan 04, 2010 at 01:25:50PM +, Stephane CHAZELAS wrote:
> >> da...@thinkpad ~/foo $ echo $PWD
> >> /home/darkk/foo
> 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*
On Thu, Jan 07, 2010 at 12:22:12PM +0100, Yann Rouillard wrote:
> ./printf.def:175: error: conflicting types for 'vsnprintf'
> Maybe you could first send me the config.log/config.h generated on
> Solaris 8 so I can compare with mine ?
It might be more useful to compare your stdio.h header file i
On Thu, Jan 07, 2010 at 09:03:19AM -0500, Chet Ramey wrote:
> *** ../bash-4.1/builtins/printf.def 2009-11-20 15:31:23.0 -0500
> --- builtins/printf.def 2010-01-07 08:50:06.0 -0500
> ***
> *** 173,177
>
> #if !HAVE_VSNPRINTF
> ! extern int vsnprintf __P(
On Wed, Jan 20, 2010 at 07:34:35AM -0800, CptDpondo wrote:
> mencoder 2>&1 | tr '\r' '\n' | grep -v -B 1 '^Pos'
>
> this eventually creates the correct output, but it's buffered until
> mencoder completes. I have no idea why; the tr command streams
> without buffering and I've used grep for
On Thu, Jan 21, 2010 at 06:11:10AM -0800, Yan Seiner wrote:
> Greg Wooledge wrote:
> >grep definitely has this buffering behavior. If you're using GNU grep,
> >you can give it the --line-buffered option to change this, at least
> >according to whichever contributor
On Wed, Jan 27, 2010 at 03:07:40PM +0200, Pierre Gaston wrote:
> On Wed, Jan 27, 2010 at 2:49 PM, Sharuzzaman Ahmat Raslan
> wrote:
> > Somehow, the backtick for foo() execute the function, echoing the correct
> > output, but fails to set the variable $gang to the correct value. Because of
> > tha
On Sat, Jan 30, 2010 at 03:17:22PM +0100, Joachim Schmitz wrote:
> Clark J. Wang wrote:
> >Hi all,
> >
> >I want to write my own built-in bash commands but I cannot find any
> >info about that in bash manual. Anyone has any idea?
>
> Have a look into the .def files in the builtins directory of bas
On Tue, Feb 02, 2010 at 07:29:25PM -0800, Davey E wrote:
> FOO[3]="ABZ555"
> shopt -s extglob
> echo '${f...@]/#!(ABZ555)/}' results in: ${f...@]/#!(ABZ555)/}
> When run, I see:
> ${f...@]/#!(ABZ555)/} results in: 5
You are trying to use a substitution operator to perform matching, which
is not
On Thu, Feb 04, 2010 at 11:54:51PM -0600, Evan Driscoll wrote:
> Why not make Bash consider \r\n a legitimate line ending? What possible
> reason could there be for treating carriage return characters as it does
> now?
Well, the most literal reason is that the shebang (#!/program) line
will not
On Tue, Feb 09, 2010 at 08:39:49AM -0900, Britton Kerin wrote:
> Well ok its not just a plain colored prompt, what I would like to use is
> this:
>
> txtred='\e[0;31m' # Red
> bldgrn='\e[1;32m' # Green
> txtrst='\e[0m'# Text Reset
> PROMPT_COMMAND=' \
> if [ $? -eq 0 ];
On Tue, Feb 09, 2010 at 09:18:47PM -0800, DennisW wrote:
> * means zero or more characters. It found zero and stopped. You could
> do:
>
> [[ '/home/' =~ /([^/]*) ]]; echo ${BASH_REMATCH[1]}
Oh, is he trying to get the first non-null component of a /-delimited
pathname? I can never tell any more
On Thu, Feb 11, 2010 at 03:04:30AM -0800, Ian wrote:
> The manual suggests I could move and close file descriptors with
>
> [n]>&digit-
>
> but I would need the equivalent of
>
> command1 >&>(...)-
>
> Digit might very well mean (just a) digit but here the process
> substitution, of course
On Thu, Feb 11, 2010 at 12:58:46PM -0500, Dave Moore wrote:
> Machine: hppa2.0w
> OS: hpux11.00
> Compiler: gcc
> Bash Version: 4.1
> Patch Level: 0
I don't have an HP-UX 11.00 machine to test on, but:
> I'm having trouble compiling bash on HP-UX 4.1. I can't figure out how to
> work around it.
On Fri, Feb 12, 2010 at 11:56:49AM +0100, Guillaume Outters wrote:
>
> I usually begin all my scripts with this beast:
>
> absolutiseScripts() { SCRIPTS="$1" ; echo "$SCRIPTS" | grep -q ^/ ||
> SCRIPTS="`dirname "$2"`/$SCRIPTS" ; } ; absolutiseScripts "`command -v "$0"`"
> "`pwd`/." ; while [ -
On Fri, Feb 12, 2010 at 02:53:39PM +0100, Bernd Eggink wrote:
> I once wrote a more generic shell function for this purpose, see:
> http://sudrala.de/en_d/shell-getlink.html
You note that it doesn't handle names containing ->, which is true.
I'll get back to that at the end.
It also won't handl
On Mon, Feb 15, 2010 at 10:20:05PM +0100, Mart Frauenlob wrote:
> > From: Curt
> > What I want to do is simply if the destination file exists, instead it
> > creates an index number and appends that to the name.
> >
> > If b.txt exists then a.txt will be renamed to b.txt.1, but if b.txt.1
On Tue, Feb 23, 2010 at 08:30:16PM +0100, Daniel Bunzendahl wrote:
> if [ !$LSEITE ]; then
You want: if [ ! "$LSEITE" ]
There are probably more errors. This is just the line you mentioned
in particular as not working.
On Tue, Feb 23, 2010 at 10:23:38PM +0100, Freddy Vulto wrote:
> Within the bash-completion testsuite, we're trying to synchronize in
> between test cases using the string "^C", output by bash on receiving a
> SIGINT.
> This works fine for bash >= 4 (typing ^C is echoed as "^C"), but on
> bash-3 typ
On Tue, Feb 23, 2010 at 05:23:00PM -0500, Chet Ramey wrote:
> That capability (readline echoing the key that generated a signal if the
> ECHOCTL bit was set with stty) was not added until bash-4.0. It's a
> settable variable in bash-4.1, so you may not want to rely on it.
... Ah, there it is. In
On Tue, Mar 02, 2010 at 03:41:36PM +0530, Kalidas Yeturu wrote:
> p=0; for lig in `cat a`; do cat b | while read i; do echo "printing $p";
> ((p=$p+1)); done; done
>
> #outputs(I DO NOT EXPECT p TO BE RESET EACH TIME WHILE RUNS)
> printing 0
> printing 1
> printing 2
> printing 0
> printin
On Mon, Mar 22, 2010 at 02:24:48PM +0100, Thomas Bartosik wrote:
> Repeat-By:
> tb...@blackknight ~ $ /usr/bin/printf "\u20AC\n"
> ?
> tb...@blackknight ~ $ type printf
> printf is a shell builtin
> tb...@blackknight ~ $ printf "\u20AC\n"
> \u20AC
Must be a GNUism. On HP-U
On Wed, Mar 24, 2010 at 04:10:41PM +0200, Pierre Gaston wrote:
> On Wed, Mar 24, 2010 at 12:43 AM, Rob Robason wrote:
> >$ ls -a | readarray# using the default MAPFILE array
> It's a faq, commands in a pipe are executed in a subshell and don't modify
> the parent shell.
And the wo
On Thu, Mar 25, 2010 at 03:32:25AM -0700, Rob Robason wrote:
> The printf builtin is broken in many variations of use of '*' (e.g., "%.*s")
> in a printf conversion spec to set field width and precision from argument
> values.
The use of '*' as a field width is not required by POSIX. According
On Mon, Mar 29, 2010 at 02:22:35PM +0200, Thomas Bartosik wrote:
> Well OK, I understand. Still I think there should be a difference in the man
> page when it comes to brackets. When talking about arrays, the brackets are
> NOT an option but mandatory.
That's correct. Referencing a specific eleme
On Tue, Mar 30, 2010 at 02:36:59PM +0800, Clark J. Wang wrote:
> After some investigation I could stably reproduce this
> problem by following steps (tested with bash 3.1.17, 3.2.39 and 4.1.0):
>
> bash$ alias xx='echo 142857'### Make sure there isn't an external cmd
> named `xx'
> bash$ expor
On Wed, Mar 31, 2010 at 11:03:17AM -0600, Bob Proulx wrote:
> Or with GNU sed using the \+ extension:
>
> FILENAME=$(ls | tail --lines=1 | sed 's/\.[^.]\+$//')
>
> I assume that 'ls' isn't what you actually are doing, that you have
> reduced the test case to something smaller (thank you for tha
On Tue, Apr 06, 2010 at 01:29:28PM +0200, Roman Rakus wrote:
> Is it possible to add more traps to arithmetic evaluation?
> Repeated by:
> $((2 ** 63 / -1))
>
> Actual result:
> SIGFPE (not catched)
>
> Initial report is https://bugzilla.redhat.com/show_bug.cgi?id=579622
Hmm, I don't get that.
On Tue, Apr 06, 2010 at 02:21:05PM +0200, Roman Rakus wrote:
> >>$((2 ** 63 / -1))
> I can reproduce it in 4.1.2(1)-release and 4.0.23(1)-release on x86_64
> GNU/Linux. I didn't try on bash 3.2.
cyclops:~$ uname -a; echo $BASH_VERSION
OpenBSD cyclops.wooledge.org 4.6 GENERIC.MP#81 amd64
4.0.24(1
On Thu, Apr 08, 2010 at 06:05:05AM -0700, Vadym Chepkov wrote:
> A company I work for is trying to migrate their applications to Linux
> platform and have selected RedHat as the vendor. Redhat installs bash as the
> standard shell :
> $ ls -l /bin/sh
> lrwxrwxrwx 1 root root 4 Jul 7 2009 /bin/sh
On Thu, Apr 08, 2010 at 10:07:32AM -0600, Bob Proulx wrote:
> Greg Wooledge wrote:
> > Migrating FROM something that used Korn shell, I presume? Why not
> > just install Korn shell and use #!/bin/ksh on your scripts, if you need
> > to rely on Korn shell features?
> Whe
On Fri, Apr 09, 2010 at 11:59:20AM -0400, Chris F.A. Johnson wrote:
> On Fri, 9 Apr 2010, Marc Herbert wrote:
> > Le 08/04/2010 22:58, Peng Yu a ?crit :
> > > $ mkdir environment\<\-
> > > $ cd environmen\<\-
> > > -bash: cd: environmen<-: No such file or directory
> > In such situations I find c
On Sun, Apr 11, 2010 at 02:56:38PM -0400, Rue U wrote:
> The "cd" command/program doesnt work with paths stored in a variable.
It does if you quote properly.
> If the variable contains the backslash.
It should not. It should contain ONLY the actual path you want.
> var=/media/New\ Folder\ Here
On Thu, Apr 15, 2010 at 09:58:42PM +0800, Clark J. Wang wrote:
> # cat foo.sh
> string=aa:bb:cc
> oldIFS=$IFS
> IFS=:
> for i in "$string"; do
> echo $i
> done
> IFS=$oldIFS
> # bash foo.sh
> aa bb cc
> #
>
> I don't understand why the $string was still splitted into words since
> it's double
On Wed, Apr 28, 2010 at 02:38:01PM -0500, Peng Yu wrote:
> I'm wondering how to start bash without inheriting any environment
> variables and user level profiles (such as .bash_profile). Would you
> please let me know what option to use?
env - "$(command -v bash)" --noprofile --norc
You'd proba
901 - 1000 of 1969 matches
Mail list logo