Bug on history control, don't erase no dups

2008-06-10 Thread B
ng a copy of the script and changing the path on the file (wich I thought to be trivial), but there is no "vim" written in there either, so I gave up. o:) Kindly, B

Bug on history control, don't erase no dups

2008-06-13 Thread B
ng a copy of the script and changing the path on the file (wich I thought to be trivial), but there is no "vim" written in there either, so I gave up. o:) Kindly, B

Re: Bug on history control, don't erase no dups

2008-06-18 Thread B
I am guessing here. Something with multiple instances of bash acessing the history. Are duplicates checked when a bash session is closed? I am making up and example with 2 instances, B1 and B2: - history of B1 and B2 initially the same: com a com b com c What happens if

Re: Bug on history control, don't erase no dups

2008-06-18 Thread B
I am guessing here. Something with multiple instances of bash acessing the history. Are duplicates checked when a bash session is closed? I am making up and example with 2 instances, B1 and B2: - history of B1 and B2 initially the same: com a com b com c What happens

Re: string substitution broken since 5.2

2022-11-03 Thread Thierry B.
Le 03/11/2022 à 18:49, Andreas Schwab a écrit : shopt -u patsub_replacement OK thanks, I read the 5.2 release notes. I just regret that this option is enabled by default, it will break many scripts running since years. -- Thierry Bothorel OpenPGP_0x81BB850F60BA2BC2.asc Description: OpenPG

[X-snmp-devel] あなたのテポドン買 います

2006-11-13 Thread $B2jLn(B
‚n‚k‚Ì•s–ž‚ð‚²‘¶’m‚Å‚·‚©H http://perfect-oneday.com/6001/37dm/ [EMAIL PROTECTED] ‰ßŒ¾‚ł͂ ‚è‚Ü‚¹‚ñB‚»‚ñ‚Ȕޏ—’B‚Í–{“–‚É•s–ž‚ª•å‚èAƒXƒgƒŒƒX‚Ì ‚Í‚¯Œû‚ð‹tƒiƒ“‚ȂǂŖü‚µ‚Ä‚¢‚Ü‚·B Å‹ß‚͏—«‚ª’j‚ð—U‚¢ƒzƒeƒ‹‚Ö’¼s‚·‚邱‚Æ‚ª‘½‚¢‚Ì‚ªŽ–ŽÀ‚Å‚·B –½—ß‚³‚ê‚é•s–ž‚ð–ü‚·‚½‚߂ɁA‚n‚k’B‚͘A‚ꍞ‚ñ‚¾’j«‚ðŽl

Calling external programs in bash script

2006-12-29 Thread Ramprasad B
Hi, I need a help in calling external programs from shell script. For example a java class or methods and c functions from a shell script. Thanks in advance for your help ! - Ramprasad B __ Do You Yahoo!? Tired of spam? Yahoo! Mail has the best

Re: at which byte do two strings differ

2008-05-06 Thread Dave B
On Tuesday 6 May 2008 07:53, Nathan Coulter wrote: > 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 can't see how this pertains to gnu.bash.bug, however try t

Re: finding the index at which two strings differ

2008-05-06 Thread Dave B
On Tuesday 6 May 2008 21:29, Bob Proulx wrote: > I can't think of any way to do this natively in bash Well, there's a loop solution, but it's a bit awkward: a=help; b=hello; i=0 while [ $i -le $((${#a}-1)) ] && [ $i -le $((${#b}-1)) ]; do if [ "${a:${i}:1}"

Re: finding the index at which two strings differ

2008-05-07 Thread Dave B
On Tuesday 6 May 2008 22:33, Dave B wrote: > while [ $i -le $((${#a}-1)) ] && [ $i -le $((${#b}-1)) ]; do while [ $i -lt ${#a} ] && [ $i -lt ${#b} ]; do -- D.

Re: Bash messes up spaces in command line agruments.

2008-05-07 Thread Dave B
On Tuesday 6 May 2008 16:20, Herrmann, Justin wrote: > Description: When I try to pass strings inside double or single quotes > as command line arguments to my Bash script, leading spaces, trailing > spaces, and multiple grouped embedded spaces are removed from the > string. This also prevents me

Re: Bash messes up spaces in command line agruments.

2008-05-07 Thread Dave B
On Wednesday 7 May 2008 14:54, Dave B wrote: > $ ./startup ' some words ' > 1 > 0 |./startup| > 0 |./startup| > 1 |some words | > 1 | some words | > # ' some words ' This

Re: unexpected behavior of 'read' builtin

2008-05-24 Thread Dave B
On Saturday 24 May 2008 02:44, Juliano F. Ravasi wrote: > Description: > > I got bitten by two unexpected (and undocumented) behaviors of > the 'read' builtin. > > The first one is that it doesn't seem to handle word separators > equally, making distinction when spaces and non-space > separators

Re: [[ ... =~ ... ]] is broken when RHS is quoted

2008-06-22 Thread Dave B
Alexis Huxley wrote: > Description: > [[ ... =~ ... ]] is broken when RHS is quoted AFAICT that seems to have changed from 3.2alpha. According to the changelog, from version 3.2alpha, "Quoting the string argument to the [[ command's =~ operator now forces string matching, as with the other

Re: [[ ... =~ ... ]] is broken when RHS is quoted

2008-06-22 Thread Dave B
Alexis Huxley wrote: > "Quote removal" means that, as usual, quotes do not form part of the > arguments, they merely serve to delimit the arguments, I take it. > "Words between [[ and ]] ... quote removal performed" means on *all* > words between [[ and ]] I take it. Hmm ... No, that can't be rig

Re: Strange return codes of continue

2008-06-27 Thread Dave B
Roman Rakus wrote: > This is realy strange. I have two examples > First: > > while [ 1 ]; do > while [ 1 ]; do > continue 0 > done > done > echo $? > > > Second: > > while [ 1 ]; do > while [ 1 ]; do > continue 0 > done > echo $? > done > echo $? > > In first case I have ech

Re: Regular expression match operation with character classes fails in bash 3.2

2008-06-28 Thread Dave B
John E. Wulff wrote: > I have just updated from "openSUSE 10.2" to openSUSE 11.0" Linux. My > backup shell script > is now broken. I tracked the problen down to the latest version of > "bash". > > The relatively new binary operator =~ does not match a regular > expression which con

Re: How to create parameterized aliases in bashrc

2008-07-26 Thread Dave B
Aman Jain wrote: > Hi > > I would like to create an alias to show Nth line of a file. > > I tried something like > alias shline='head -$1 $2 | tail -1' #$1 is the line number and $2 > is the filename ># Usage should be : > $shline 5 fi

Re: 'read' primitive

2008-08-22 Thread Dave B
Bob Proulx wrote: > To get the entire line verbatim you would need to use the $REPLY > variable. Or also use IFS= read -r foo < bar -- D.

Re: Equivalent of ksh, zsh {N}<[WORD] ?

2008-08-26 Thread Dave B
Pierre Gaston wrote: >> > On Tue, Aug 26, 2008 at 5:41 AM, R. Bernstein <[EMAIL PROTECTED]> wrote: >> > > Both zsh and ksh have a way to open a file or duplicate a file >> > > descriptor and let the interpreter pick the descriptor saving the >> > > newly-allocated file descriptor number in a v

Re: Equivalent of ksh, zsh {N}<[WORD] ?

2008-08-26 Thread Dave B
Pierre Gaston wrote: >> I think he refers to the fact that, with ksh, you can do for instance >> >> $ exec {fd}<&0 >> $ echo $fd >> 10 >> $ exec {fd1}<&0 >> $ echo $fd1 >> 11 >> >> I didn't try on zsh, but with bash you get: >> >> $ exec {fd}<&0 >> -bash: exec: {fd}: not found >> > ah sorry I didn

Re: Maximum limit of pipes in a single command ?

2008-08-28 Thread Dave B
Keshetti Mahesh wrote: > Hi all, > > Can anyone tell me what is the maximum limit of number of pipes > that can be opened through a single command ? > > e.g; # ||| .| For what is worth, on my system (bash 3.2.33(1)-release) I can have 3332 pipes before bash give

Re: Formating variable with caracter and date.

2008-12-12 Thread Dave B
Dolphin06 wrote: > Hello all, > > I would like to give a variable a value which have a format like this one: > <3 letters>-- > should be yymmdd. Date of the day by default. > How would i do this, i know the date command is date +"%y-%m-%d", but i dont > know the syntax for mixing letters date a

Re: $(grep anycommand anyfile) fail

2008-12-24 Thread Dave B
BlackEnvil wrote: > Description: using ` ` or $() with command that use dirnames with spaces > fail. > > there are diferent dirnames with this problem, and different situations that > cause these errors, not only with ls and not only with grep. > > bye > > > Repeat-By: > > [blacken...@space_s

Re: Howto set a Readline variable (not in the init file!)?

2009-01-12 Thread Dave B
Andi Bachmann wrote: > Hello > > I'm looking for a way to set a Readline variable, but without editing > the init (~/.inputrc or /etc/inputrc) file. > > E.g., I'd like to have > >set show-all-if-ambiguous on > > The thing is that I have to login to some remote server with a login > that I

Re: No tilde expansion right after a quotation

2009-02-16 Thread Dave B
tain spaces.) >> There are some contexts, such as variable assignments, where double >> quotes are not necessary. >> >> foo='a b' >> bar=$foo >> >> is just as safe as >> >> bar="$foo" >> >> In fact, it is MORE porta

Re: IFS valid characters

2009-03-16 Thread Dave B
he Bourne shell, pdksh or zsh, IFS is an > internal field terminator, not separator ("a:b:" is split > into "a" and "b", not "a" and "b" and "" which makes it > inappropriate to split $PATH for instance) (in the Bour

Re: $\n doesn't get expanded between double-quotes

2009-07-03 Thread Dave B
On Friday 03 July 2009, Richard Neill wrote: > > X=$'a\nb c' > > This is still a missing feature: how to embed newlines in double-quoted > bash string assignment: > > For example, if I want to write: > > EMAIL_BODY="Dear $NAME,$'\n\n'Here are the log-files for > $(date)$'\n\n'Regards,$'\n\n'$SENDE

Re: Possible Feature Requests (unsource, exchange)

2009-07-07 Thread Dave B
On Tuesday 07 July 2009, Christopher Roy Bratusek wrote: > Hi all, > > what I'm currently missing are the following two things (I'm not 100% > sure if they are not available): > > unsource: the opposite of source (while source is making functions > publically available, unsource would remove them)

Re: regarding 'time' builtin

2009-07-17 Thread Dave B
On Friday 17 July 2009, Linda Walsh wrote: > where does the output from the 'time' command "go" > > I.e. if I wanted to pipe the output to a prog or file, how would I > go about doing it? Please see http://mywiki.wooledge.org/BashFAQ/032 -- D.

Re: 'time' redirection, and pipe redirections in general

2009-07-25 Thread Dave B
On Saturday 25 July 2009, Linda Walsh wrote: > AFAIK, I'm still screwed if I want to create more than one > pipe for outputs -- either sending stderr to one pipe and stdout to > another, OR a way of even doing what "tee" does, but built into the > shell, so I could, using the building "tee", a f

Re: Bash script file naming problem?

2009-07-25 Thread Dave B
On Saturday 25 July 2009, michael rice wrote: > Is there a problem with naming a bash script file "script"? I'm using > Fedora 11. "script" is most likely the name of a command installed on your system (on mine, it's /usr/bin/script). Try "man script" and see. So if you really want to call your s

Re: Bug in array populating does not respect quotes

2009-09-24 Thread Dave B
On Thursday 24 September 2009 16:38:12 David Martin wrote: > Description: > When populating an array from a string in a variable does not > handle quotes. > > Repeat-By: > > ~$ declare -a samplearray > ~$ samplearray=( x y 'z k') > ~$ echo ${samplearray[2]} > z k > ~$ samplestring="x y 'z

Re: Real easy questions. Please answer

2009-09-25 Thread Dave B
On Friday 25 September 2009 05:24:04 eatsubway wrote: > sry i have a stupid question. > > I have a variable and need to know how many items are in it. > > for example: > variable="abc xyz foo" > what program can i call to print out 3 > > right now im doing this... > > Counter() > { > echo $#

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Dave B
On Friday 09 October 2009, Pierre Gaston wrote: > > Repeat-By: > >printf '%s\n%s\n' foo bar | while read NAME; > >echo NAME=$NAME > >do > >echo blah > >done > > Not sure what is the incorrect syntax, and it seems normal that it goes > into an infinite lo

Re: bash accepts script with incorrect syntax and goes into infinite loop

2009-10-09 Thread Dave B
On Friday 09 October 2009, Pierre Gaston wrote: > > Well, it seems to me (and as stated in the bug report) that a "do" should > > follow the "while read NAME;". > > the while syntax is like this: > "while list; do list; done" > and the manual says "A sequence of one or more newlines may appear in

Re[2]:Greeting !

2005-03-28 Thread Marinka B.
) Yourth faithfully Marinka B. ___ Bug-bash mailing list Bug-bash@gnu.org http://lists.gnu.org/mailman/listinfo/bug-bash

UID|EUID variables lose their ro properties

2017-11-03 Thread mike b
Hi! Below is some odd stuff I recently noticed, looks to me as a bug, though it's better if smarter people than me look at it as well to confirm that. :) Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OS

Unexpected (?) segfault after unset LANG

2018-02-09 Thread mike b
Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I

Re: Unexpected (?) segfault after unset LANG

2018-02-09 Thread mike b
1b in execute_command_internal () #10 0x0043737e in execute_command () #11 0x004213be in reader_loop () #12 0x0041fca5 in main () (gdb) 2018-02-09 16:21 GMT+01:00 Chet Ramey : > On 2/9/18 9:55 AM, mike b wrote: > > > Bash Version: 4.3 > > Patch Level: 33 >

Re: Unexpected (?) segfault after unset LANG

2018-02-09 Thread mike b
en code after first call, however, after LANG is toggled, printf keeps returning just the code. I guess my question here is: why that happens? I mean, I would expect it to decode it whenever LANG is set back to UTF-8 in this case. Am I missing something here? 2018-02-09 17:29 GMT+01:00 Chet Ramey

Reading from a file by using its FD returns its contents only once

2018-12-30 Thread mike b
Configuration Information: Machine: x86_64 OS: linux-gnu Compiler: gcc Compilation CFLAGS: -DPROGRAM='bash' -DCONF_HOSTTYPE='x86_64' -DCONF_OSTYPE='linux-gnu' -DCONF_MACHTYPE='x86_64-pc-linux-gnu' -DCONF_VENDOR='pc' -DLOCALEDIR='/usr/share/locale' -DPACKAGE='bash' -DSHELL -DHAVE_CONFIG_H -I. -I

Re: Reading from a file by using its FD returns its contents only once

2018-12-31 Thread mike b
That's a good point, I haven't thought about it like this. I always thought that each read always starts at the beginning of the file given fd points at. So the fact that it changes offset is a bit surprising: # echo word >t # exec {in} napisał(a): > On Mon, Dec 31, 2018 at 2:37

Re: Reading from a file by using its FD returns its contents only once

2018-12-31 Thread mike b
I have the full picture now. Thank you all for your feedback!

\w, $PWD and pwd builtin return "//" instead of '/'

2019-01-12 Thread mike b
Upon changing directory, with "//" passed as an argument, the trailing '/' is still displayed when cwd is looked up by Bash: bash-5.0# cd // bash-5.0# pwd // bash-5.0# echo $PWD // bash-5.0# PS1=${PS1/\$/\w\\$} bash-5.0//# # \w -> "//" bash-5.0//# /bin/pwd # <- coreutils implementation / bash-5.0

Re: \w, $PWD and pwd builtin return "//" instead of '/'

2019-01-12 Thread mike b
o say. Or at least remember to run through the FAQ. :) Anyways, thanks for your feedback! niedz., 13 sty 2019 o 02:43 Chet Ramey napisał(a): > On 1/12/19 7:52 PM, mike b wrote: > > Upon changing directory, with "//" passed as an argument, the trailing > '/' > &g

Re: read builtin is not honoring -t argument

2013-12-12 Thread Todd B. Stein
I'm very sorry; I believe I may have wasted your time. After further testing, I can only reproduce this using xfce4-terminal (0.6.2) in Fedora 19. Read works fine in gnome-terminal and on tty's, so I hereby respectfully retract my report. Thank you for the work you guys do! Just to show I'm not (c

Re: Parameter Substitution Causing Memory Leak

2014-01-07 Thread Todd B. Stein
These bugs result in gradual slowdown of indefinitely-running scripts which rely on parameter substitution (rather than forking sed or awk) for speed and efficiency. Forgive me if I used the wrong terminology, but whether these bugs are considered honest-to-goodness "memory leaks" by valgrind seems

#! /bin/sh bash problem

2008-03-29 Thread John B. Brown
attempting to configure source for compiling. So far, any UNIX and Linux packages act the same; the above error. Fix: attempting to revert bash versions is not working; the older program will not download from openSuSE update sites. Shalom, John B. Brown. [EMAIL PROT

Re: #! /bin/sh bash problem

2008-03-30 Thread John B. Brown
Dear Bob, Thank you for that reminder of my mortality. Bob Proulx wrote: John B. Brown wrote: Description: Attempting to run 'configure', or any shell script with #! /bin/sh, results in the error message: "bash: ./configure: /usr/bin/bash: bad interpreter: Permiss

Re: #! /bin/sh bash problem

2008-03-30 Thread John B. Brown
Dear Bob, Thank you for your answers. Bob Proulx wrote: John B. Brown wrote: Thank you for that reminder of my mortality. :-) Bob Proulx wrote: Also, /usr/bin/bash is not a normal location for bash. Normally bash would reside in /bin/bash . Perhaps you also have one

Re: printf "%q" and $'...'

2009-11-25 Thread Lhunath (Maarten B.)
On 25 Nov 2009, at 16:27, Antonio Macchi wrote: >> imadev:~$ echo $'foo\0bar' >> foo > > > sorry... I'm a little bit confusing... look > > $ echo foo$'\0'bar > foobar > I expect $'\0' expands to the C-string ''. Which then gets added to the argument after 'foo' and before 'bar'.

Re: IFS handling and read

2009-11-30 Thread Lhunath (Maarten B.)
On 30 Nov 2009, at 11:34, Marc Herbert wrote: > Eric Blake a écrit : >> >> This is E4 in the FAQ: >> ftp://ftp.cwru.edu/pub/bash/FAQ >> >> POSIX permits, but does not require, that the final element of a pipeline >> be executed in a subshell. Bash uses the subshell, ksh does not. >> Variable as

Re: operators available in bash versions

2009-11-30 Thread Lhunath (Maarten B.)
On 30 Nov 2009, at 12:12, Gerard wrote: > > I apologize for asking what is probably a dumb question, but where can > I find a definitive listing of what features are available in each > version of Bash. > > For example, I only have access to Bash-4 on my system. I need to know > if " $(< " also

Re: IFS handling and read

2009-11-30 Thread Lhunath (Maarten B.)
On 30 Nov 2009, at 14:10, Marc Herbert wrote: > > Lhunath (Maarten B.) a écrit : >> On 30 Nov 2009, at 11:34, Marc Herbert wrote: >> >>> Eric Blake a écrit : >>>> This is E4 in the FAQ: >>>> ftp://ftp.cwru.edu/pub/bash/FAQ > >> Inste

Re: IFS handling and read

2009-11-30 Thread Lhunath (Maarten B.)
On 30 Nov 2009, at 15:56, Chris F.A. Johnson wrote: > > On Mon, 30 Nov 2009, Greg Wooledge wrote: > >> 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: >>>

Re: IFS handling and read

2009-11-30 Thread Lhunath (Maarten B.)
On 30 Nov 2009, at 16:15, Chet Ramey wrote: > > Lhunath (Maarten B.) wrote: > >> Note that 'read' is a bash feature; not a POSIX shell feature. In that >> sense, "read" alone is limiting your "portability". So portability in the >>

bash --login in Cygwin environment does not use %HOME% when doing tilde expansion.

2005-02-16 Thread Axel B. Bregnsbo
e. Repeat-By: Set HOME in the ControlPanel>System>Advanced>EnvironmentVariables>User variables for abb Invoke bash by calling bash.bat containing: @echo off c: chdir C:\bin\cygwin\bin bash --login -i Axel B. Bregnsbo ASIC Designer, M.Sc.EE +45 44855990 [EMA

Re: echo -n

2017-02-02 Thread Jyoti B Tenginakai
Sangamesh Mallayya Cc: "bug-bash@gnu.org" , Jyoti B Tenginakai Date: 02/02/2017 08:45 PM Subject:Re: echo -n On Thu, Feb 2, 2017 at 11:02 AM, Sangamesh Mallayya < sangamesh.sw...@in.ibm.com> wrote: Hi, description: in bash echo -n , echo -e

Re: echo -n

2017-02-05 Thread Jyoti B Tenginakai
yoti Jyoti Tenginakai AIX-Security Development Team IBM India Software Lab EGD 'D' Block Sixth Floor Off Indiranagar Koramangala Intermediate Ring Road Bangaluru - 560071 ph: 4177 extn: 7 Mail:jyoti@in.ibm.com From: Chet Ramey To: Jyoti B Tengi

bash vs sh / ticks appearing

2007-12-29 Thread Tuc at T-B-O-H.NET
Hi, I normally run a program on FreeBSD using its sh, and it runs fine. When I brought it over to Linux using bash its doing some strange stuff... SCRIPT: #!/bin/sh -x SCRIPT=$1 shift EMAIL=$1 echo $SCRIPT $SCRIPT 1>/tmp/mailifoutput.$$ 2>&1 sh/FreeBSD output: # ./script

Re: bash vs sh / ticks appearing

2007-12-29 Thread Tuc at T-B-O-H.NET
> > "Tuc at T-B-O-H.NET" <[EMAIL PROTECTED]> writes: > > > When I brought it over to Linux using bash its doing > > some strange stuff... > > > > SCRIPT: > > > > #!/bin/sh -x > > > > SCRIPT=$1 > > shift > &

show-all-if-ambiguous broken?

2005-11-22 Thread Com MN PG P E B Consultant 3
In my .inputrc I have: set print-completions-horizontally on set show-all-if-ambiguous on Despite of this, I have to type TWICE to get the completions listed. Is there a bug in the completion system, or do I miss yet another option? I'm using bash 2.05b (unfortunately, upgrading to 3.x is n

RE: show-all-if-ambiguous broken?

2005-11-24 Thread Com MN PG P E B Consultant 3
> > In my .inputrc I have: > > > > set print-completions-horizontally on > > set show-all-if-ambiguous on > I cannot reproduce it. Do you use the programmable completion > package? I rarely use it (and can't check it right now). I don't know which completion package is installed (how can I

RE: show-all-if-ambiguous broken?

2005-11-24 Thread Com MN PG P E B Consultant 3
> 1. Are you sure your inputrc is being read? Yes, I had verified this in two ways: First I have changed some of the character bindings in my .inputrc, and then I have typed Ctrl-X Crtl-R on the shell prompt. The effect was that my character binding had changed, but the completion behaviour was

RE: show-all-if-ambiguous broken?

2005-11-28 Thread Com MN PG P E B Consultant 3
> Did `echo $INPUTRC' display anything? THAT WAS IT! THAT WAS IT! THANK YOU SO MUCH! This variable was set (maybe by some malevolent sysadmin) to /etc/inputrc. It still puzzles me why bash, despite of this, was able to see the keybindings I had defined in *my* ~/.inputrc; maybe readline always t

HERE document mystery

2005-12-15 Thread Com MN PG P E B Consultant 3
Is this a bug, or just my misunderstanding about the scope of the "HERE" operator (<<)? Consider the following program: echo THIS WORKS cat

RE: HERE document mystery

2005-12-16 Thread Com MN PG P E B Consultant 3
> "Com MN PG P E B Consultant 3" > <[EMAIL PROTECTED]> wrote: > > echo THIS DOES NOT WORK > > foo=$(cat exp_test < > V=1234 > > abcd > > BAD > > 0. Since you passed a file name to cat, it will ignore stdin. > 1. Since the here-docume

Keybinding "yank 0th arg", "delete backward argument"

2006-03-23 Thread Com MN PG P E B Consultant 3
I would find the following two functions useful in bash command line editing; is it possible to simulate them somehow with the current bash version, or would this have to be a new feature in a future version of bash? (1) yank 0th arg, similar to yank-last-arg, but copies the command part of the pr

Backquote Mystery

2006-03-23 Thread Com MN PG P E B Consultant 3
While hunting a bug in my script, I stumbled over an effect involving the usage of backquote and grep, which completely puzzles me. To reproduce the effect, execute first the following four commands, which create a small directory tree in your working directory and set the bash variable 'e':

RE: Backquote Mystery

2006-03-23 Thread Com MN PG P E B Consultant 3
> Try echo "$e". Then read about Word Splitting in the Bash manual. Good point. Since no word splitting occurs within "$e", it is expanded to a string containing newlines: $ echo $e # Expansion without quotes -> word splitting x sub: f $ echo "$e" # Expansion with quotes -> no word splittin

RE: Keybinding "yank 0th arg", "delete backward argument"

2006-03-27 Thread Com MN PG P E B Consultant 3
> > (1) yank 0th arg, similar to yank-last-arg, but copies the > command part > > of the previous line > > into the current buffer. Example: The previous line was > > > > /usr/local/bin/perl myprog.pl > > > > then yank-0th-arg should insert /usr/local/bin/perl into the buffer. > > M-0 M-. (digi

How to enable 'realpath'

2006-04-21 Thread Com MN PG P E B Consultant 3
I don't see how to enable the 'realpath' builtin: $ enable realpath bash: enable: realpath: not a shell builtin I'm running bash 2.05b.0(1), so realpath should be a loadable builtin here, isn't it? Ronald ___ Bug-bash mailing list Bug-bash@gnu.org h

strange segmentation violation in connection with <<< redirection

2006-08-03 Thread Com MN PG P E B Consultant 3
With bash 2.05b (unfortunately I have no access to a more recent version) under Linux, there is a strange error, which can be demonstrated with the following script - let's call it "segv": #!/bin/bash --norc schodo="" fgrep -q <<<$schodo If this script is executed, I get the following er

why doesn't this error message go to the bit bucket?

2006-08-28 Thread Com MN PG P E B Consultant 3
$ unalias fooee 2>&1 >/dev/null bash: unalias: fooee: not found Why is the error message displayed here? Because of the redirection, I had expected that any error message resulting from the unalias command would go to /dev/null Ronald -- Ronald Fischer (phone +49-89-63676431) mailto:[EMAIL PROTE

RE: why doesn't this error message go to the bit bucket?

2006-08-28 Thread Com MN PG P E B Consultant 3
> > $ unalias fooee 2>&1 >/dev/null > > bash: unalias: fooee: not found > > > > Why is the error message displayed here? > > Because you have redirected stderr (fd 2) to the channel connected to > stdout (fd 1) before stdout was redirected to a different channel (to > /dev/null). Of course! Stupi

How to suppress "Terminated..." message after kill

2006-09-20 Thread Com MN PG P E B Consultant 3
My bash program basically does: tail -f file >outfile & killpid=$! ... kill $killpid >/dev/null 2>&1 ... Still I get the message (PID) Terminated tail -f file >outfile at the end of my script. Is there a way to suppress this message? (bash 2.05b) Ronald -- Ronald Fi

RE: How to suppress "Terminated..." message after kill

2006-09-22 Thread Com MN PG P E B Consultant 3
> Com MN PG P E B Consultant 3 wrote: > > (PID) Terminated tail -f file >outfile > > Is there a way to suppress this message? (bash 2.05b) > > Use: > set +m > Why is monitor set for your script? That would only be typical for > interactive s

logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
Does someone know how to deal with the following situation? Very often I do the following pattern: (1) rlogin to a foreign host (2) Invoke a subshell (for example because I'm setting a Clearcase View) (3) Logout from the host Step (3) needs two steps: First I have to type 'exit' to leav

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> How about > function rlogin() {command rlogin "$@"; exit} > ? H I don't see how this could help me. Actually, your solution would EXIT the shell I came from, after the login has finished!! So I not only have to type all the "exit"s on the remote host, I would even loose my current shell

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> >rlogin foobar > >DO SOME STUFF > >cleartool setview myview # this creates a subshell > >DO MORE STUFF > >cleartool setview yourview # now I'm two subshells deep > >DO STILL MORE STUFF > ># Now I want to exit > >exit > >exit > >logout > > > > I would like t

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> >(1) rlogin to a foreign host > >(2) Invoke a subshell (for example because I'm setting a > Clearcase > > View) > > Is it a subshell or a second-level shell? (In the first case, $$ and > $PPID remain the same.) Could you kindly explain the difference? I thought it's always the same - a

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> > I can't use traps here, because I know only at "exit time", whether > > I want to logout completely, or just go up one level. > > $ call_and_exit() { "$@"; if test $? -eq 42; then exit; fi; } > $ call_and_exit cleartool ... > $ exit 42 This looks clever. Maybe one should use "exit 42" too in

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> >(1) rlogin to a foreign host > >(2) Invoke a subshell (for example because I'm setting a > Clearcase > > View) > >(3) Logout from the host > > > > Step (3) needs two steps: First I have to type 'exit' to leave the > > subshell, and then either 'exit' or 'logout' to leave the > log

RE: logout from interactive subshell

2006-10-12 Thread Com MN PG P E B Consultant 3
> What about in your login (.bash_profile, etc) exporting a > variable, say > ROOT_PID=$$ and having a command/function/alias 'kill -s SIGHUP > $ROOT_PID'? This is equivalent to killing the rlogin connection, but > should clean up nicely if all you have are shells. Excellent idea! Thank you fo

Why is this executed inside a subshell?

2006-11-27 Thread Com MN PG P E B Consultant 3
Consider the following program: #!/usr/local/bin/bash --norc export VAR=A function setvar { VAR=B echo X } V=$(setvar) echo $VAR When I execute it, I get as result "A", not "B", as I had expected. If setvar would be an external program, I would understand the result, a