Re: truncating the path in the bash prompt?

2007-11-01 Thread Dan Nicolaescu
Stephane Chazelas <[EMAIL PROTECTED]> writes: > On Thu, Nov 01, 2007 at 08:01:58AM -0700, Dan Nicolaescu wrote: > > > > In tcsh %c can be used to only show the last few directory names in a > > path (also see the ellipsis variable). > > > > For example for this directory: > >

Re: truncating the path in the bash prompt?

2007-11-01 Thread Stephane Chazelas
On Thu, Nov 01, 2007 at 08:01:58AM -0700, Dan Nicolaescu wrote: > > In tcsh %c can be used to only show the last few directory names in a > path (also see the ellipsis variable). > > For example for this directory: > > /lib/modules/2.6.21-1.3194.fc7/kernel/drivers/char/hw_random/ > > the pro

Re: Problem with reading file and executing other stuffs?

2007-11-01 Thread Paul Jarc
Horinius <[EMAIL PROTECTED]> wrote: > cat test.txt | > while read line Read entry E4 in the bash FAQ: http://tiswww.case.edu/php/chet/bash/FAQ paul

Re: run-fg-editor for bash?

2007-11-01 Thread Stephane Chazelas
On Thu, Nov 01, 2007 at 07:48:13AM -0700, Dan Nicolaescu wrote: > > In tcsh the command run-fg-editor bound by default to C-M-z is > extremely useful when you have an editor suspended. > It makes it very easy to return to the editor, do some editing, then > suspend the editor again, and the comma

Problem with reading file and executing other stuffs?

2007-11-01 Thread Horinius
I've been struggling with the following code of reading a text file (test.txt) and counting the number of lines. Well, I know there're simpler method to count the number of lines of a text file, but that's not the point of this post. __ n=0 cat test.txt | while read line do n=$(

truncating the path in the bash prompt?

2007-11-01 Thread Dan Nicolaescu
In tcsh %c can be used to only show the last few directory names in a path (also see the ellipsis variable). For example for this directory: /lib/modules/2.6.21-1.3194.fc7/kernel/drivers/char/hw_random/ the prompt can look like this: [EMAIL PROTECTED]:...drivers/char/hw_random> when using

run-fg-editor for bash?

2007-11-01 Thread Dan Nicolaescu
In tcsh the command run-fg-editor bound by default to C-M-z is extremely useful when you have an editor suspended. It makes it very easy to return to the editor, do some editing, then suspend the editor again, and the command line is restored in exactly the same state as it was before doing C-M-z

Re: Why does this kill my box?

2007-11-01 Thread Tomas Janousek
Hello, On Thu, Nov 01, 2007 at 11:25:58AM +, Steve P wrote: > $0 = "test"; expands to "../test.sh = test" and recurses (runs itself with parameters "=" and "test"). > tail -f /var/log/messages > > chmod +x test.sh > ../test.sh -- Tomas Janousek, SW Engineer, Red Hat, Inc.

Why does this kill my box?

2007-11-01 Thread Steve P
vi test.sh $0 = "test"; tail -f /var/log/messages chmod +x test.sh ../test.sh Seems to spawn loads of bash processes. 2.6.22-14-386 Linux GNU bash, version 3.2.25(1)-release (i486-pc-linux-gnu)

builtin printf behaves incorrectly with "c and 'c character-value arguments

2007-11-01 Thread Rich Felker
$ printf %d\\n \'À -61 (expected 192) This should be 192 regardless of locale on any system where wchar_t values are ISO-10646/Unicode. Bash is incorrectly reading the first byte of the UTF-8 which happens to be -61 when interpreted as signed char; on a Latin-1 based locale it will probably give -

Re: Passing variables to awk

2007-11-01 Thread Andreas Schwab
TimtheEagle <[EMAIL PROTECTED]> writes: This is actually all unrelated to bash. > + awk -v 'var1=Framed-IP-Address = 10\.6\.6\.' '/*** Received from > 10.242.252.20 port 1645 /{ last_acct_status = NR; as = $0 }/Code: `*' and `.' are special in regexps, you need to quote them to match t

Passing variables to awk

2007-11-01 Thread TimtheEagle
Hi all, having created a complicated (for me) awk statement previously with the forums' help I am now amending it and trying to pass variables to it. My script is as follows with the respective outputs (hash then unhash when running etc) for:- 1. variable var1 passed containing Framed-IP-Address