mwoehlke [EMAIL PROTECTED] wrote:
I thought the syntax was only two ''s?
gives you a here-document. gives you a here-string. Check
the man page for details.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Andrew Kezys [EMAIL PROTECTED] wrote:
So, when I'm running the shell script that calls on this python script
and end it with ctrl-c, it only ends the shell script, and not the
python script, which continues putting serial data to a file.
Ctrl-C should be sending SIGINT to both bash and python.
box [EMAIL PROTECTED] wrote:
void ${NAME}Panel::showEvent(QShowEvent *e) {
...code
}
I want to be able to run my script, have it read the contents of the files
while replacing ${NAME} with a variable that is defined elsewhere in my
script.
NAME=...
eval cat EOT
$(cat template-file)
[EMAIL PROTECTED] (Martin Wheatley) wrote:
(ie commands are only executed when the user hits enter and NOT
executed when an I/O error occurs on the input stream).
EOF is not an error. If there is an error, then certainly bash should
not execute an partial command it has buffered, but that
[EMAIL PROTECTED] wrote:
ls -1 | while read f; do
Read entry E4 in the bash FAQ.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
Linda Walsh [EMAIL PROTECTED] wrote:
Two aliases:
alias ls='ls -CFG --show-control-chars --color=tty '
alias dir='ls'
If I type ls dir (created a test dir called dir), I
get:
ls dir
I get:
ls: ls: No such file or directory.
man bash, under ALIASES:
# If the last character of
[EMAIL PROTECTED] wrote:
Aliases don't work correctly in command substitution when in
noninteractive mode. They do work when in interactive mode.
man bash, under ALIASES:
Aliases are not expanded when the shell is not interactive, unless the
expand_aliases shell
Cai Qian [EMAIL PROTECTED] wrote:
It suggests that cat has not seen EOF (004) generated by echo.
The character 004 is not EOF.
When typing at a terminal which is set to cooked mode, you use the
keystroke control-D to tell the terminal driver that it should send
EOF to the program reading from
Cai Qian [EMAIL PROTECTED] wrote:
For following code,
sh EOF
read
EOF
I have no idea why will not block.
The read command reads from the shell's stdin, which is the here
document. At the point where the read command is executed, the
shell has already read the read command from the
I wrote:
sh EOF 30
read 3
EOF
Sorry, that first line should be:
sh 30 EOF
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
Peter Volkov [EMAIL PROTECTED] wrote:
$ [[ string =~ [a-z] ]] echo something
something
[a-z] matches only one charater, but the pattern is not required to
match against the entire string. You can force it to match the whole
string by using ^ to anchor the pattern to the beginning of the
Mike Frysinger [EMAIL PROTECTED] wrote:
$ foo=a b c
$ gawk 'BEGIN {foo='${foo}'}'
gawk: BEGIN {foo=a
gawk:^ unterminated string
This is normal. man bash:
# Word Splitting
# The shell scans the results of parameter expansion, command substitu-
# tion, and
Charlie Bennett [EMAIL PROTECTED] wrote:
Is this expected behavior?
[EMAIL PROTECTED] .ssh]# [ -f ]
[EMAIL PROTECTED] .ssh]# echo $?
0
Yes. A single argument is considered true if it is not the mepty
string, even if it happens to coincide with the spelling of an
operator. This is how all
Steve Grubb [EMAIL PROTECTED] wrote:
On Tuesday 04 April 2006 15:51, Chet Ramey wrote:
How about commands whose output may be assigned to shell variables?
Yes, they can be acquired in a number of ways. But what we are trying to do
is
set things up so that people using this in a classified
William Yardley [EMAIL PROTECTED] wrote:
I would still like to know if there's a way to bind ^W to
backward-kill-word within bash, so if anyone has suggestions, I'd
appreciate them.
Check out the bind builtin command in the man page or help bind.
paul
Wolf-Rainer Novender [EMAIL PROTECTED] wrote:
e.g. ls [A-Z]* should yield in all names starting with capital letters.
Does not work! I get all names!
http://www.gnu.org/software/coreutils/faq/#Sort-does-not-sort-in-normal-order_0021
paul
___
Bob [EMAIL PROTECTED] wrote:
XXX='a b c d'
for x in $XXX ; do
echo $x
done
XXX='a b c d'
eval set $XXX
for x in $@ ; do
echo $x
done
If the first element in XXX might start with -, then it takes a
little more work to ensure it isn't misinterpreted as
Dirk H. Schulz [EMAIL PROTECTED] wrote:
ac=12 dings$ac=wasannersder
-bash: dings12=wasannersder: command not found
Variable names in assignments are not subject to expansion. So since
dings$ac, as-is, does not fit the syntax for variable names, it
isn't treated as an assignment. This will
Dirk H. Schulz [EMAIL PROTECTED] wrote:
Paul Jarc schrieb:
ac=12 eval dings$ac=wasannersder
And how do I reference it then?
ac=12 eval value=\$dings$ac
echo $value
Or:
ac=12 name=dings$ac echo ${!name}
paul
___
Bug-bash mailing list
Bug-bash
Dan Jacobson [EMAIL PROTECTED] wrote:
No way to hand echo or /bin/echo a NULL.
For /bin/echo, that's because execve() uses null-terminated strings.
For bash's builtin echo, it could be done, but then it would be
inconsistent with external commands, which might be surprising.
paul
G C McNeil-Watson [EMAIL PROTECTED] wrote:
If you do an
ls -ld directory/
for some existing directory then the output contains TWO trailling
slashes:
drwx-- 2 pypgcm users 4096 Aug 16 2005 directory//
The directory and the first slash appear in blue on my terminal, trailing
[EMAIL PROTECTED] wrote:
Normally, the eval builtin used in functions to set variables
makes these variables available globally otutside the function.
However, when the function gets input from a pipline, the variables
are set only locally.
Read the bash FAQ, entry E4.
Dan Jacobson [EMAIL PROTECTED] wrote:
Must one use \: to make this work?
That, or adjust $COMP_WORDBREAKS to not include :.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
http://lists.gnu.org/mailman/listinfo/bug-bash
Johannes Thoma [EMAIL PROTECTED] wrote:
[EMAIL PROTECTED]:~/bash/bash-3.1$ zak=`printf '\x0d\x0a'`
As documented in the man page under Command Substitution, this
strips off any trailing newlines from the program's output before
assigning the variable's value. So zak contains only a carriage
[EMAIL PROTECTED] wrote:
a exit inside a loop inside a pipe exits's the loop and not the
script. may bee a error.
This is normal. Each element of a pipeline is run in a child process.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Eric Blake [EMAIL PROTECTED] wrote:
But the RATIONALE (XCU line 35443) states that The ! operator has higher
precedence than the -a operator, and the -a operator has higher precedence
than the -o operator. Therefore, when -a is defined as a unary operator,
an XSI compliant test is required to
Chet Ramey [EMAIL PROTECTED] wrote:
`echo' now displays an error message on write errors.
In the case of a SIGPIPE trap, is it intended that echo sees EPIPE
before the SIGPIPE handler runs?
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
Com MN PG P E B Consultant 3 [EMAIL PROTECTED] wrote:
echo THIS DOES NOT WORK
foo=$(cat exp_test BAD | tr -d V= | grep '[0-9]*')
V=1234
abcd
BAD
0. Since you passed a file name to cat, it will ignore stdin.
1. Since the here-document belongs to the command in $(), the
here-document must
Scott Dylewski [EMAIL PROTECTED] wrote:
I get an error when running:
echo $(( 008 / 2 ))
Numbers starting with 0 are interpreted as octal, and so can only use
digits 0-7. You'll have to strip off the leading zeros to make the
number be interpreted as decimal.
paul
fabien [EMAIL PROTECTED] wrote:
when programming an auto-completion with embedded : in the
complete names, the auto-completion does not look good.
By default, : is treated like whitespace for completion, to help
when setting variables like $PATH. Check the man page for
Antonis [EMAIL PROTECTED] wrote:
Using ansi escape sequences in the prompt causes Bash to incorrectly
calculate the available width of the terminal and messes-up the command
prompt when a certain amount of characters are typed in.
See entry E3 in the bash FAQ.
paul
Denis Vlasenko [EMAIL PROTECTED] wrote:
The problem is that svc -d (or manual kill -TERM)
kills bash but nmeter and logger continue to run,
until I kill nmeter manually.
It's best not to put a long-running pipeline in a daemontools run
script, for just this reason (among others). Instead,
[EMAIL PROTECTED] wrote:
If a command in a pipeline of commands fails, there appears to be no
way of knowing this.
Check the man page regarding the PIPESTATUS array.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
readline/shlib/Makefile uses INSTALL_DATA to install shared libraries.
INSTALL or INSTALL_PROGRAM would seem more appropriate; at least on
GNU/Linux, gcc creates shared libraries with the execute bit set, and
ldd warns if it is not set.
paul
___
[EMAIL PROTECTED] wrote:
bash# a=500; b=0$[a]; c=$[b]; echo -e a: $a\nb: $b\nc: $c\n
a: 500
b: 0500
c: 320
man bash, under ARITHMETIC EVALUATION:
Constants with a leading 0 are interpreted as octal numbers.
paul
Chet Ramey [EMAIL PROTECTED] wrote:
Readline, beginning with version 5.0, reads the stty special character
settings and binds them to their readline equivalents each time
readline() is called. It reads ~/.inputrc once per `program'.
Suggestion: when reading .inputrc, update the stty settings
[EMAIL PROTECTED] wrote:
When sourcing a bash script from a 'parent' script the
parameters/args supplied to the 'parent' script are passed
on to the sourced script (!)
This is the traditional behavior, required for compatibility with
other shells and existing scripts.
[EMAIL PROTECTED] wrote:
I had been using ${HOSTNAME%%.*} in my prompt to show the local
host name portion of my full host name (e.g. localhost instead
of localhost.localdomain). After enabling the nullglob shell
option, this pattern is being replaced by a null
Chet Ramey [EMAIL PROTECTED] wrote:
I am considering manipulating the `environ' variable when bash's list
of exported variables changes. That might be enough to make the libc
getenv() work.
I can't quite tell what's going on in lib/sh/getenv.c, but could you
(if you don't already) use libc's
William Park [EMAIL PROTECTED] wrote:
It would be nice if I can read a file and process it as though it was
here-document text in the script. Mainly, I want variable substitution,
without calling lots of 'sed'.
eval blah EOT
`cat file`
EOT
But this breaks if file contains an EOT line.
paul
Philippe Torche [EMAIL PROTECTED] wrote:
aPipe='|'
eval echo 'titi' $aPipe grep toto | grep titi
This is equivalent to:
eval echo titi | grep toto | grep titi
The whole eval counts as one pipeline element, regardless of what's
inside it, so the top-level pipeline is only connecting two
Hugh Sasse [EMAIL PROTECTED] wrote:
Where does it normally live?
dirent.h, or another file included there.
glark -r \bDIR\b /usr/include:/usr/local/include
The shell processes one level of escaping/quoting.
glark -r '\bDIR\b' /usr/include:/usr/local/include
paul
Norbert Nemec [EMAIL PROTECTED] wrote:
How about using a double star ** to signify recursive globbing, i.e.
globbing for arbitrarily deep paths?
FWIW, zsh already has that.
paul
___
Bug-bash mailing list
Bug-bash@gnu.org
root wheel [EMAIL PROTECTED] wrote:
echo $10
Use ${10}. man bash:
When a positional parameter consisting of more than a single digit is
expanded, it must be enclosed in braces (see EXPANSION below).
paul
___
Bug-bash mailing list
Chet Ramey [EMAIL PROTECTED] wrote:
That's what the `--' first argument is for: don't treat any remaining
arguments as possible options.
Does printf have any options? If not is there any point in giving an
error in this case? ISTM SUSv3 requires the first argument to be a
format string,
Chet Ramey [EMAIL PROTECTED] wrote:
The SUSv3 has `none' in the OPTIONS section of the printf description.
The description of that value in the `Utility Description Defaults'
section of the standard requires that commands which accept operands
but not options to recognize `--' and handle it
True Logik [EMAIL PROTECTED] wrote:
Is there a way to de-install BASH or set my system back to the way it
was before the install? I really need a working Terminal... :-(
If you installed the OS X package, then that's more of an OS X
question than a bash question. Check in an OS X forum.
101 - 147 of 147 matches
Mail list logo