ias ub='echo bye'
hi
bye
Now, I expect the last two lines to read "bye" but they don't.
Bob
o yes; else echo no; fi
ed> q
if true; then echo yes; else echo no; fi
yes
> C-d bash: syntax error: unexpected end of file
exit
Just another rendition of the same thing.
Bob
uted patch didn't include a configuration option, I didn't add one.
Highlighting the region is a completely separate concept from
bracketed paste mode as the region is used in many completely
unrelated places. It pains me that they are coupled.
Bob
te mode avoids it for the paste but doesn't address the reverse
video of search.)
Bob
SSLKEYLOGFILE
/home/user/test
Using grep is fine. But then the human must interpret the results
accordingly. I think here understanding that 'set' is doing what is
expected and reasonable is enough. However I would use 'env' to avoid
the internal data state. And programatically neither are sufficient
for a fully robust program and other methods should be used.
Bob
Dirk Wetter wrote:
> PS + @Bob: fd 5 is not a tty in the program -- but interactively in
> this PoC you want to make sure it is not taken yet.
Understood. I originally mentioned the isatty() thing because that is
how libc decides to line buffer or not. But Chet has confirmed that
ely if someone is using the external time it might
give them an unexpected result. Since the external time will not know
anything about a pipeline. So this might catch people off guard too.
$ TEST=foo time -p sleep 1 | sleep 2
real 1.00
user 0.00
sys 0.00
When used it is best to always pu
Mike Gerwitz wrote:
> Bob Proulx wrote:
> > Let me give the discussion this way and I think you will be
> > convinced. :-)
>
> Well, thanks for taking the time for such a long reply. :)
>
> > How is your example any different from a C program? Or Perl, Python,
&
Chet Ramey wrote:
> Bob Proulx wrote:
> > Put this in your ~/.bashrc file and I believe your use case will be
> > much happier.
> >
> > shopt -s checkhash
>
> How many installers put a new version of an existing package into a
> possibly-different directory
gram traps a signal then it should restore the default signal
handler for that signal and send the signal back to itself. Otherwise
the exit code will be incorrect. Otherwise parent programs won't know
that the child was killed with a signal.
For a highly recommended deep dive into this:
https://www.cons.org/cracauer/sigint.html
Hope this helps!
Bob
signature.asc
Description: PGP signature
nged a behavior back
in the day when it was added and deviated from the previous csh
behavior. Therefore being an optional option makes sense. But I
don't see a downside to defaulting to it now. In any case I always
add it to my bashrc file. (Along with "shopt -s checkwinsize" too.)
Bob
Chet Ramey wrote:
> It's that bash sets stdout and stderr to be line-buffered, not anything
> printf-specific.
Shouldn't bash set stdout buffering based upon the output descriptor
being a tty or not the same as other libc stdio behavior?
Bob
Chet Ramey wrote:
> Bob Proulx wrote:
> > It was also noted in another message that the external standalone
> > printf command line utility did buffer as you desired. That seems
> > another very good solution too. Simply use "command printf ..." to
> > force
Robert Elz wrote:
> Bob Proulx wrote:
> | Using the same buffer size
> | for input and output is usually most efficient.
>
> Yes, but as the objective seemed to be to make big packets, that is probably
> not as important.
The original complaint concerned flushing a data
"one\ntwo\n", 1048576) = 8
write(1, "one\ntwo\n", 8) = 8
read(0, "", 1048576)= 0
+++ exited with 0 +++
It seems to me that using a large buffer size for both read and write
would be the most efficient. It can then use the same buffer that
data was read into for the output buffer directly.
Bob
I see that you have subscribed now. Awesome! If you and others would
be so kind as to list-reply instead of CC'ing me directly that would
be great. I read the replies on the mailing list.
dirk+b...@testssl.sh wrote:
> Bob Proulx wrote:
> > You are doing something that is quite
f the two.
| cat
Or probably better:
| dd status=none bs=1M
Or use whatever block size you wish. The 'dd' program will read the
input into its buffer and then output that block of data all in one
write(2). That seems to be what you are wanting.
Good luck! :-)
Bob
P.S. You can possibly use the 'stdbuf' command to control the output
buffering depending upon the program.
info stdbuf
to impossible to find any
running Unix-like system outside of a museum environment that still
behaved that old way.
And certainly any using the fractional second extension is past any
need to worry about the problem. Because any such system with the
problem would only handle to a granularity of integer seconds anyway.
Bob
to convince yourself.
Nothing Stéphane said changed my statement at all.
It does look like bash can be more efficient with argument handling.
Since, for example, dash does it.
Bob
arguments in memory. I suggest refactoring the
program to avoid the need for this memory stress.
Bob
nd other GNU utilities have done it for some
> time. What do folks think?
I think the non-rational ranges in libc were a terrible idea that we
have all been suffering with over the last decade plus.
Bob
Chet Ramey wrote:
> Bob Proulx wrote:
> > Denys Vlasenko wrote:
> >> $ f() { for i; do echo "|$i|"; done; }
> >> $ x=x
> >> $ e=
> >> $ f ${x:+ ""}
> >> ^^^ prints nothing, bug?
> >>
> >> $ $
void the
whitespace getting stripped. (Is that during word splitting phase
using the IFS? I think so.)
Try this:
f "${x:+ ""}"
f "${x:+"" }"
Also in the future please say what version of bash you are using.
There have been a lot of bugs fixed in various versions.
Bob
ready had three replies
in the thread and therefore I have now approved it and passed it on.
For better or worse. For b...@packages.debian.org everyone subscribed
to the package list got a copy from there already.
Bob
ve a full editor available to you for editing
them. Don't try to recall and edit them on the command line. There
is a very old joke that goes, "Patient: Doctor it hurts when I do
this. Doctor: Then don't do that."
Bob
fail
because it would not know the directory was renamed and would be
unable to return to it.
Bob
Processes
killed by the OOM have no opportunity to clean up or log anything.
Or vm.overcommit_memory can be configured the traditional Unix way
where enough virtual memory needs to exist or malloc() and fork() will
fail. IMNHO overcommit off is the best way for enterprise servers.
However overcommit on is convenient for laptops.
Bob
o not meddle in the affairs of 'set -e' for it is
subtle and quick to anger.
Bob
th a special option
(-DSYS_BASHRC) that makes bash read /etc/bash.bashrc before ~/.bashrc
for interactive non-login shells. So, on Debian systems,
/etc/bash.bashrc is to ~/.bashrc as /etc/profile is to
~/.bash_profile.
Bob
Yuri wrote:
> Bob Proulx wrote:
> > How is the user logging in? Are they logging in with 'ssh' over the
> > network? Or are they logging in through an "xdm" X Display Manager
> > login from a graphical login display?
>
> User logs in locally throug
long* discussion of
how each graphical login environment works. Therefore more
information about your environment would be needed.
> Is this a bug?
I feel confident that it is a consequence of how the shell is started.
Bob
same with this being my
last comment here upon it too.
> Bob Proulx said (in a message with the original subject):
> | You can use the shared kitchen but please leave it in a better state than
> | you found it.
>
> That would be fine, and would be free use. But
>
>
Robert Elz wrote:
> Bob Proulx wrote:
> > However this difference in philosophy does not change the technology
> > that creating a compiler for an interpreted language is very hard.
> > Maybe impossible.
>
> No. Not impossible, not even all that difficult, just i
the
problem and restricting the language it is possible. Just not useful
at that point.)
Therefore regardless of our differences what you want is not easy to
do on a technical level.
I don't want to suggest this but... Instead of obfuscating the shell
script program it would be better if you chose a compiled language
from the start. Then you could simply compile it and have what you
want.
Bob
Jonny Grant wrote:
> Please keep my email address in any replies
>
> Bob Proulx wrote:
> > Jonny Grant wrote:
> > > Yes, it's a known limitation of POSIX that it uses a shared error code for
> > > both files and directors, ENOENT. Which without programmer
W such as Bash for Windows
or Cygwin so that all of your external dependencies are satisfied.
Or using a different language such as C which is natively compiled.
Or using a restricted set of Perl, Python, Ruby, or other that already
has a compiler available for that restricted subset.
Bob
for longer about this, than it would have
> been to fix it.
I see no bug to fix here. However I fear that trying to fix an
imaginary one would introduce a bug here.
Bob
nd now every kernel that has followed since. Since
that is the common behavior among all systems the standards bodies
will mostly say, freeze on that behavior, do it the same way, don't do
it differently. Surely that is a good thing, right?
The subtleties of https://www.cons.org/cracauer/sigint.html about how
programs should behave were learned not all at once but over the
course of time.
Bob
of the program. Software is all about layers
and abstraction. Sending the signal to one self to raise the signal
again feels good to me.
POSIX even added a raise(3) call to make this easier. (Although I
still do things the old way.)
man 3 raise
Bob
am exit WIFSIGNALED information is now correct.
Signal handlers should always raise the signal on themselves after
handling whatever they need to handle first.
In any case I can't recreate your problem when using real processes in
separate shells not all on one line.
Bob
Kae Verens wrote:
> but, if you do this:
> cd // ; pwd
>
> then the CLI reports
> //
Using two "//" at the start of a path name is special because in some
systems it means the path component that follows is a hostname.
Therefore it must be preserved verbatim.
Bob
ing
lists write to the mailing list owner at bug-bash-ow...@gnu.org to
contact the humans who help with the mailing list. This is the email
address convention for all of the Mailman managed mailing lists.
Bob
)())|>_[$($(<<0)) crashes bash on Debian, Red Hat, FreeBSD, etc.
>
> It's marked as `Done'.
Since it is both marked as Done and also reported to be resolved in
bash 4.4 then I have closed the ticket.
Bob
ng out of memory then it is almost certainly
due to inefficient shell scripting. For example like one that I
analyzed in this thread. Of course that is just one of many
possibilities.
http://lists.gnu.org/archive/html/bug-bash/2011-11/msg00189.html
Bob
. But mostly they are very unusual cases. Not
typical cases.
Bob
ing bash.
Normally I am doing things like this:
logger -t cmdname "my log message here"
But you can get the format you wish with:
logger -t "cmdname[$$]" "your log message here"
Bob
h shell. In other words to change it for bash
you would need something like this:
$ ...shell with LC_COLLATE set to en_US.UTF-8 with bad collation ...
$ env LC_COLLATE=C bash
$ ... works now ...
I mention this because otherwise people try changing the variable and
then don't see a change in the already running bash shell.
Bob
.
I think the statement in the Apple man page is there because someone
liked -L over -h and wanted to scare everyone into using one over the
other. But there isn't any reason to do so.
Bob
m Europe than from the US. There isn't a reproducible test
case to show if a change fixes things or not. I in Colorado have a
hard time triggering any problems but have been able to on occasion.
But people in Europe have been most of the problem reports. Most of
them have been using IPv6.
And that is all I know.
Bob
ng with dangerous
commands such as rm then it is wise to check twice before invoking.
echo rm * .jpg
If you saw the result then you would fix it before invoking the
command for effect. If the result is bad then correct it. If the
result is good then remove the echo and run the command for effect.
Bob
on't worry about it. It is all in the past now.
Bob
message had no
moderation delay probably due to previous contact there.
Please have some patience.
Bob
Benno Schulenberg wrote:
> Bob Proulx wrote:
> > I do not have a nanorc file at all. The defaults are okay for
> > suspension without any specific configuration.
>
> ?? How does that work? What version of nano are you using?
Since this has nothing to do bash I am goin
Benno Schulenberg wrote:
> Bob Proulx wrote:
> > [...] this is the perfect case for job control. No need for a
> > second terminal. Here is an example. Use Control-Z to stop the
> > foreground job.
>
> For that to work, it requires having 'set suspend' i
grep a
rwp@havoc:~$ jobs
rwp@havoc:~$
Simply stop the process and then kill it using the same terminal.
Bob
P.S. The other suggestions to use Control-X to exit nano are also good
too but job control is general for the entire class type of commands
like this and I think good to know too.
months.
(And work with times from the middle of the day.) That still isn't
absolutely perfect but is good for most calculations. For example:
date --date="$(date +%Y-%m-15) +1 month" +'Next month is %B.'
And so your case might best be phrased:
date -R
Wed, 27 Jan 2016 13:10:20 +0800
date --date="$(date +%Y-%m-15) +1 month" +'%b%Y'
Feb2016
Bob
without such a
check. Or any of the many compatible /bin/sh variants such as ksh,
zsh, ash, dash, and so forth.
Bob
Linda Walsh wrote:
> Bob Proulx wrote:
> >Where does the OS claim it is a file descriptor?
> 1) in the kernel documentation:
> file 'devices.txt:
> /dev/fd /proc/self/fd symbolicFile descriptors
That shows the file descriptor map for the process.
in 'a': instead:
Syntax error in the above. You probably meant to have 'read' read
from the pipe and not hand it to read as a variable name argument.
echo read var <(sort a)
read var /dev/fd/63
You probably meant to use a '<' input redirection there.
read var < <(sort a) && echo "var=$var" >a
# equates to: read var < /dev/fd/63
That works as you expected.
Bob
ESC C-y will rotate the kill ring to the
previous killed text. Repeating ESC C-y again rotates to the one
before it. So can walk back through until finding the text I want to
yank back. :-)
Bob
ents from one command and other arguments
from other commands and stitch them together. Since they were all in
the growing roll of trash piling up out of the back to the terminal it
was fairly easy to do. Take a pen and underline the numbers you used
often in that session to make them easier to see.
Bob
$rc -ne 0 ]; then
echo "Error: failed: ..." 1>&2
exit 1
fi
Bob
he filed above. He filed a ticket on the
web site and then mailed a reference to it here.
Bob
nately I have no time for
comments about the rest of the code.
Bob
ing and the output will appear on the tty
immediately without need for opening it synchronously or flushing or
anything extra.
Bob
urs?
That is the wrong direction to go. It is like saying, I have this
problem building a small bike shed. I couldn't figure it out.
Therefore I downloaded the plans to the Eiffel Tower in order to
compare the two. They are not really comparable. Trying to do so is
just a distraction from solving your real problem.
Bob
hat
read has options documented. This works.
/^ *read *\[
Bob
for
efficiency now but everything behaves the same if they are external
programs. This is why quoting as if they were external programs is
required. On the other hand [[ has always been a builtin and
therefore the shell can avoid one layer of quoting and does.
Bob
reset
(the line-feed character is normally control-J) to get the
terminal to work, as carriage-return may no longer work in the
abnormal state. Also, the terminal will often not echo the
command.
Otherwise the best you can do is to close the terminal and start a new
one.
Bob
Please pardon the incorrectly handled anti-spam message re-send seen
today. One of the listhelper volunteers had a problem vivifying an
incorrectly classified false-positive-as-spam message. Accidents
happen. Your patience and tolerance is appreciated.
Bob
ed to any web browser problem either.
I don't know where I would direct you for further assistance. I think
if you could locate a local user group community they would provide
useful assistance to you face-to-face.
Bob
the output of a program into the cut buffer you can pipe
it to xclip. Or pull text out of the buffer with xclip.
Bob
e shells.
$ bash -c 'echo $(case yes in (yes) echo yes ;; (no) echo no ;; esac)'
yes
Bob
ure fringe Unix lookalike
systems did exactly that in their shell. I forget details now. But
because of that some of us do always use ":" instead of an empty
redirection simply due to it.
Bob
Vladimir Kanazir wrote:
> Bob Proulx wrote:
> >The bash default is not to set that variable. But it looks like you
> >are using Ubuntu and the Ubuntu package default is to set it in the
> >default .bashrc file as a user level customization.
>
> Yes, they broke many t
bashrc file. Customize it
as you desire.
Bob
r that case explicitly.
Since this is a question and not a bug in bash it would be better
discussed in the help-b...@gnu.org mailing list instead. Please send
future use discussion there. Thanks.
Bob
make hopping around systems less
verbose.
touch ~/.hushlogin
Bob
improved there.
One problem in your example is that your bash does not have a tty
attached to it. Add -t to ssh and you will then get a tty and you
won't need to redirect 2>/dev/null anymore.
ssh -t localhost bash
Bob
Dennis Williamson wrote:
> Bob Proulx wrote:
> > I see a lot of hits in the bash_completion add-on files. Should we be
> > looking at:
> >
> > $ grep -r "shopt -s extglob" /etc/bash*
> > /etc/bash_completion.d/nmh:shopt -s extglob
> >
d/subversion:# pattern matching enabled (use 'shopt -s
extglob progcomp' to enable
/etc/bash_completion.d/subversion:shopt -s extglob
Bob
w prompt. I think that is an
unreasonable expectation. There hasn't ever been a communication
interface for doing such a thing. One could be created. But if so
then that would be a *new* interface.
Bob
signature.asc
Description: Digital signature
u want it
sorted then you will have to read the 'ps' man page and add your
preferred sort order.
If you wish to followup on the ps issue please do so on the
help-gnu-ut...@gnu.org mailing list and not here on the bash bug list.
The help-gnu-utils list is a relatively generic mailing list for
random help discussion about the utilities and the discussion would be
fine there.
Bob
Daniel Colascione wrote:
> Bob Proulx wrote:
> > I use paste into the shell with an embedded newline in order to
> > immediately execute a command *a lot*. If that were removed I would
> > be very unhappy.
>
> I strongly doubt that your use case is typical.
It does
as an idea that I hadn't thought about before. (I often
would paste into my editor and clean it up. But doing it as part of
the edit-and-execute-command is very nice!)
Thanks for this hint!
Bob
teraction after a paste to begin
> execution, making this attack much less effective.
I am very happy this is a feature you like. However I would hate that
feature. It should definitely not default to on or it will make
people like me very unhappy.
Bob
provide more
> information. Could you please start out by helping me there?
What type of file system is your ~/.bash_history located upon? This
sounds like a deja vu from the ext4 file system. Do you observe any
other zero sized files after a reboot?
Bob
targeted that too. So while bash might or might not do some of that
it isn't really the project for it.
Bob
Chet Ramey wrote:
> Bob Proulx wrote:
> > That is one of the reasons I don't like the /dev/std{err,in,out}
> > things. They are not portable. They do different things on different
> > systems. I avoid them.
>
> I've considered emulating it everywhere, rega
gument. There is
> no internal Bash magic happening. You get the underlying operating
> system implementation, or you get "no such file or directory".
That is one of the reasons I don't like the /dev/std{err,in,out}
things. They are not portable. They do different things on different
systems. I avoid them.
Bob
ore processes. But try this:
for i in file[12] ; do program -i "$i" -o >(cat) ; done >outfile
Good luck!
Bob
Dennis Williamson wrote:
> Bob Proulx wrote:
> > And the subshell isn't needed either. Use a list.
> >
> > { for i in file[12] ; do cat "$i" ; done ;} > both
>
> There's no need for the curly braces and the last semicolon.
Of course you are t
l isn't really part of the issue. The issue is that the
file descriptor is attached and truncated and that is orthogonal to
process boundaries.
Hope that helps!
In the future please consider asking questions such as these on
help-b...@gnu.org for general discussion of bash shell scripting. If
you expose a bug then report the bug to the bug reporting address.
The help-bash list is for help with bash scripting and this would have
been perfect there.
Bob
ble for you to cut yourself on one? Think about how
you would make a kitchen knife safer. Give it a serious think. Then
ask yourself this question. Would you use such a knife that you
designed yourself? The answer is invariable no. There has always
been some inherent danger when using a kitchen knife. We accept this
because the alternatives are all worse.
Bob
Andreas Schwab wrote:
> Bob Proulx writes:
>
> > #!/bin/bash
> expect -c '...' "$_usr" "$_host" "$_passwd"
Of course that works too. Why were you so late to share this wisdom?
> RTFM?
It has probably been more than fifteen years s
ight happen, usually HUP, INT, QUIT, TERM, and
perhaps PIPE though PIPE is definitely subtle and special. It is
rather of a mess. Bash is definitely better in this regard.
Bob
#!/bin/bash
unset tmpfile
cleanup() {
test -n "$tmpfile" && rm -f "$tmpfile"
}
trap "cleanup&
elp-bash mailing
list rather than the bug-bash mailing list. The help-bash list is
relatively new and so we are always reminding people to use it when
appropriate.
Bob
ntrolled by the line-move-visual
variable. Call me a Luddite if you want but in emacs 24 I turn that
feature off. I am very much "used to using" the traditional behavior
and like it.
Thinking about it I think that the recent addition of line-move-visual
to emacs and not to libreadline is probably the reason for the request
for this feature.
Bob
C-c M-p
for next and previous line? I think there would be and it would just
be an endless cycle.
As Chet said the mental model of what is happening at those two points
of action in each program is different.
Bob
P.S. This is going to be a rant and run because I am offline for
several days after this.
issues to bug-bash.
Bob
1 - 100 of 510 matches
Mail list logo