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 loop since echo
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 a
list
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 $#
}
Counter
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 k'
~$
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 file
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 script
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.
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)
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 share
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_star ~]$ cd
Dolphin06 wrote:
Hello all,
I would like to give a variable a value which have a format like this one:
3 letters-date-digit
date 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
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; # cmnd ||| .|
For what is worth, on my system (bash 3.2.33(1)-release) I can have 3332
pipes before bash gives
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 variable. In
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't know this syntax
on which
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.
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 file.txt
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 contains a
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 echoed 1. And I am
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
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 right
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 are
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.
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
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 should have been
$ ./startup ' some words
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 this:
echo
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} = ${b:${i}:1} ]; then
i=$((i+1))
26 matches
Mail list logo