Re: bug when 'cd ..' to a directory who's parent has been deleted

2016-02-08 Thread Dave Rutherford
On Mon, Feb 8, 2016 at 11:34 AM, Linda Walsh wrote: > Chet Ramey wrote: >> On 2/8/16 9:59 AM, Andreas Schwab wrote: >>> Chet Ramey writes: `cd ..' should fail, since the parent no longer exists, and the pathname canonicalization should fail, since there's presumably no longer a valid >>

Re: Future date

2016-01-24 Thread Dave Rutherford
On Sun, Jan 24, 2016 at 5:30 PM, Val Krem wrote: > I am trying to get a variable that combines the next month(Feb) and current year (2016) from the current date [...] > temp_date=$(date | awk -F ' ' '{print $2,$6}' | tr -d ' ') Wow, that's overkill. You don't need the -F ' ' options to awk, sin

Re: why must bash zap last search string just because we hit ^C?

2015-10-17 Thread Dave Rutherford
On Sat, Oct 17, 2015 at 11:19 PM, 積丹尼 Dan Jacobson wrote: > > "DW" == Dennis Williamson writes: > > DW> Or just open a new terminal rather than interrupting an in-progress > search. > > I am on a device where opening a new terminal is a lot of trouble. > Can you run gnu screen? ^A-c will ge

Re: remaking bash, trying static, glibc refuses static...?

2015-08-20 Thread Dave Rutherford
On Wed, Aug 19, 2015 at 5:55 PM, Linda Walsh wrote: [cut a lot about dynamic linking and the linux kernel] > Even bash can load many of it's builtin's dynamically -- but if they > aren't there, it could use the same named-programs -- and I don't > think it "falls-over" and dies if it can't dynamic

Re: Bug, feature or just the correct behaviour (stat'ing -bash down the PATH)

2015-06-03 Thread Dave Rutherford
On Tue, Jun 2, 2015 at 9:08 AM, Wheatley, Martin R < martin.wheat...@ccfe.ac.uk> wrote: > a truss of "bash -ls" shows it stat'ing '-bash' in each of the directories > in PATH... > > 11933: stat64("/usr/bin/-bash", 0xFFBFEBE8)Err#2 ENOENT > 11933: stat64("/usr/sbin/-bash", 0xFFBFEBE8)

Re: Memory leak in wait

2015-03-02 Thread Dave Rutherford
On Mon, Mar 2, 2015 at 2:33 AM, Jean Delvare wrote: > Which brings another question: is there any plan to implement sleep as > a bash builtin? It's already available as a loadable builtin (examples/loadables/sleep.c).

Re: Tab completion breaks for tilde-paths with filenames containing space

2015-01-14 Thread Dave Rutherford
On Wed, Jan 14, 2015 at 10:14 AM, Eduardo A. Bustamante López wrote: > Can you test with: > bash --norc --noprofile -i It is working in this case. The difference seems to be in direxpand. $ shopt -s direxpand; shopt direxpand direxpand on $ vi ~/a/a\ [nothing] $ shopt -u direxpand

Re: Tab completion breaks for tilde-paths with filenames containing space

2015-01-14 Thread Dave Rutherford
On Wed, Jan 14, 2015 at 9:45 AM, Eduardo A. Bustamante López wrote: > On Wed, Jan 14, 2015 at 09:33:31AM -0500, d...@evilpettingzoo.com wrote: > [...] >> Bash Version: 4.2 >> Patch Level: 37 Also tested on 4.3.30 > [dualbus@dualbus ~]$ mkdir a; >a/a\ a.txt You didn't create any ambiguity there.

Re: bash uses tmp files for inter-process communication instead of pipes?

2014-10-06 Thread Dave Rutherford
On Tue, Oct 7, 2014 at 2:25 AM, Dave Rutherford wrote: **it.. sorry for the fat finger post. Gmail puts the tiny formatting options right next to the big SEND button. Ratzen fracken.

Re: bash uses tmp files for inter-process communication instead of pipes?

2014-10-06 Thread Dave Rutherford
On Tue, Oct 7, 2014 at 2:07 AM, Linda Walsh wrote: > > > Pierre Gaston wrote: > >> >> b=<<<$a is not doing anything so I wonder how much value this example has. >> > --- > I wondered about that.. think that was meant to be the > b=<<<($a) w/o the copy that greg said was pointless. > >> >> A pipe

Re: bash-4.3 bug report

2014-04-14 Thread Dave Rutherford
On Mon, Apr 14, 2014 at 12:22 PM, David Binderman wrote: > Anyone experienced looking at the code will always need to examine it > more closely to find out why it's a good idea in this case to use an array > index and *then* sanity check it's value. But in this case it's a limiting check, not a b

Re: When a hashed pathname is deleted, search PATH

2014-03-17 Thread Dave Rutherford
On Mon, Mar 17, 2014 at 10:12 AM, Chet Ramey wrote: > On 3/15/14 2:44 PM, Reuben Thomas wrote: >> On 15 March 2014 18:23, Chet Ramey > > wrote: >> Is there a downside to making checkhash the default? > > Only the minor performance hit it would extract on every command l

Re: [PATCH] Adding support for '--' in builtin echo's option parsing.

2013-04-01 Thread Dave Rutherford
On Mon, Apr 01, 2013 at 03:16:07PM +0300, Hemmo Nieminen wrote: > > Description: > > Currently it seems to be impossible to e.g. print "-n" with the > > builtin > > echo witout any extra characters. > > You should use printf instead. The echo command is a historical artifact > wh

Re: How to run something before invoking the inputted command?

2010-07-12 Thread Dave Rutherford
On Mon, Jul 12, 2010 at 08:16, Greg Wooledge wrote: >> On Sat, Jul 10, 2010 at 11:30 AM, Eric Blake wrote: >> > Not quite before the command, but it is very easy to include $(date) as >> > part of PS1 to have a timestamp listed in the prompt that is printed >> > after every command. > > On Sat, J

Re: Failed bash -r command returns 0 exit status

2010-05-24 Thread Dave Rutherford
On Mon, May 24, 2010 at 08:32, Greg Wooledge wrote: > On Mon, May 24, 2010 at 04:25:48AM -0400, Dave Rutherford wrote: >> On Mon, May 24, 2010 at 02:48, Pitt, David wrote: >> >        status. This is not expected (at least not by me!). Zero exit >> > status is returne

Re: Failed bash -r command returns 0 exit status

2010-05-24 Thread Dave Rutherford
On Mon, May 24, 2010 at 02:48, Pitt, David wrote: >        However executing "/bin/ls && /bin/ls" under a restricted shell > returns a zero exit >        status. This is not expected (at least not by me!). Zero exit > status is returned with >        any list of commands, e.g. "/bin/ls && :". Tha

Re: how to start in "overwrite-mode"

2009-10-28 Thread Dave Rutherford
On Tue, Oct 27, 2009 at 16:29, Jim Lawson wrote: > 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" >

Re: Creating directories with sticky bit set

2009-03-13 Thread Dave Rutherford
On Fri, Mar 13, 2009 at 9:30 AM, Greg Wooledge wrote: > This still doesn't address the original poster's concerns if, for > example, a web browser creates a new ~/.browserconf directory the first > time it's invoked. But nothing bash can do will solve that. True, but what about a wrapper? --- s

Re: for ... in ... do ignores escape characters

2008-04-18 Thread Dave Rutherford
On Thu, Apr 17, 2008 at 4:21 PM, luiscolorado <[EMAIL PROTECTED]> wrote: > Hello, everybody... I'm suffering a huge problem with the "for" command > because it wants to parse a variable ignoring escape characters. > > For example, as you know, if I do something like this in bash: > > for i in s

Re: converting an array into a single variable

2008-02-20 Thread Dave Rutherford
On Wed, Feb 20, 2008 at 2:42 PM, Natan Shar <[EMAIL PROTECTED]> wrote: > I can do this with a few id numbers using php, but I need to do this with > thousands of id numbers on a daily basis using a cron job > > I can successully build an array of the filenames using: > declare -a imagelist='ls

Re: Comparison failure

2008-01-10 Thread Dave Rutherford
Chet Ramey wrote: > Dave Rutherford wrote: > > Now, "[[" isn't very well documented, so I tend not to use it, > > I'm always interested in suggestions for improving the bash documentation. > Can you tell me what's unclear about the existing description

Re: Comparison failure

2008-01-10 Thread Dave Rutherford
On Jan 10, 2008 8:13 AM, Frans de Boer <[EMAIL PROTECTED]> wrote: > Following is a function which fails constantly. [...] > if [[ $i != -1 && $i < $((iPriTblCnt-1)) ]]; then > echo $((i+1)); > else > echo -1 > fi Now, "[[" isn't very well documented, so I tend not to use it, but noti

Re: reading whitespaces and beginning and end of line

2007-12-07 Thread Dave Rutherford
On Dec 7, 2007 5:49 AM, sancho1980 <[EMAIL PROTECTED]> wrote: > i have a script that reads lines from a file in this manner: > > cat infile | while read line > do > echo "$line" >> outfile > done > > The problem I have occurs whenever there is a whitespace at the end of a > line in the input fi

Re: question and/or enhancement request

2007-07-29 Thread Dave Rutherford
On 7/29/07, Erick Wodarz <[EMAIL PROTECTED]> wrote: > I think the following is hard (or impossible?) using bash. I want to > create a shell script that will ... This may be possible, depending on exactly what you need, but you'd probably be better off trying `expect'. #!/bin/bash mknod pipe_t

Re: Subnet address

2007-07-21 Thread Dave Rutherford
On 7/21/07, Archimerged Ark Submedes <[EMAIL PROTECTED]> wrote: On 7/20/07, Mike Frysinger <[EMAIL PROTECTED]> did not read the question. Neither did you. ;-) Asked for was a solution using ifconfig and bash; you added grep and tr. Yes, that's entirely reasonable on your part, but it's not n

Re: Evaluate expression every time directory changes

2007-06-29 Thread Dave Rutherford
On 6/28/07, bash_user <[EMAIL PROTECTED]> wrote: Lets say I would like to update environment variable based on ${PWD} should I clobber my prompt generation routine or there is a better way. Something like this? PROMPT_COMMAND='eval NEWPWD="\$PWD"' Dave __

Re: How to detect bash?

2006-10-10 Thread Dave Rutherford
On 10/10/06, mwoehlke <[EMAIL PROTECTED]> wrote: Completely non-workable. That only works if the bash I want is in /bin/bash Well, no. It works as long as the last thing in the path is 'bash'. It could be /usr/bin/bash, /home/bin/bash, or yes, /bin/bash. But why the heck don't you know, if t

Re: How to detect bash?

2006-10-10 Thread Dave Rutherford
On 10/10/06, mwoehlke <[EMAIL PROTECTED]> wrote: Anyone have any clever, VERY reliable tricks for detecting if the current shell is bash? Well, I don't know if it's clever, but how about: $ if [ "${SHELL//*/bash}" = "bash" ]; then echo y; fi But better to use the hash-bang and make SURE the s

Re: null command and parameter expansion for "Display error if null or unset"

2006-07-31 Thread Dave Rutherford
On 7/31/06, Paul Jarc <[EMAIL PROTECTED]> wrote: "Dave Rutherford" <[EMAIL PROTECTED]> wrote: > On 7/31/06, Poor Yorick <[EMAIL PROTECTED]> wrote: >> : ${FAKEVAR?} || echo hello > > Try this and then run your script: > > export FAKEVAR="

Re: null command and parameter expansion for "Display error if null or unset"

2006-07-31 Thread Dave Rutherford
On 7/31/06, Poor Yorick <[EMAIL PROTECTED]> wrote: The following line does not perform the "echo" command. : ${FAKEVAR?} || echo hello This seems inconsistent, since the return status is set to one, not to mention that the null command is documented to return a zero exit code. It would be a

Re: PATH and $0

2006-07-11 Thread Dave Rutherford
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote: I want its full pathname using 'dirname', but it will give me unexpected result on some Linux or Bash versions. Well, 'dirname' certainly won't do what you want, but I'm sorry, I can't think of a way to get what you need. (It would be relatively

Re: PATH and $0

2006-07-11 Thread Dave Rutherford
On 7/11/06, Cai Qian <[EMAIL PROTECTED]> wrote: In some Linux, it will print "/tmp/script.sh", while in other, it will print "script.sh" only. Which is wrong? If both are fine, is there any better way to make it portable? Which do you want? (Both are fine.) If you want 'script.sh', use 'basen

Re: bash feature request: pushd -v, popd -v

2005-07-15 Thread Dave Rutherford
On 7/15/05, Ben Horowitz <[EMAIL PROTECTED]> wrote: > I grew to appreciate one feature of tcsh: the ability to use > the commands pushd -v, and popd -v. > > As you know, when the bash pushd and popd commands are successful, > they print the directory stack. In tcsh, one can additionally issue > th