I have just been looking at the page again and thinking about how to improve my answer. The user might write "my name is Zainab and I'm a marine biologist"
I tried bash, zsh, mksh, lksh, and a new version of yash, all of which support shopt -o pipefail. None of them placed a different value in $? from a crash when it was placed there due only to pipefail being enabled than when it would be placed there anyway. This appears unique to ksh93, though the self-crashing behavior (raising a signal on exit when $? is higher than 256) also appears unique to ksh93.
The question we recently undeleted?
I wasn't thinking of doing so. Maybe. But I wouldn't post an answer about autocompletion.
The only sort of answer I'd be interested in posting there is something you would be better at posting: a sed solution. This covers the first branch, but not the second:
sed -rn 's/[Mm]y name is (.+)/hi, \1/p;q'
@Zanna I don't know how either, but I'm pretty sure it can be done, because in bash the read builtin use GNU Readline if the -e option is passed, and GNU Readline supports autocompletion.
Should I move some of these messages to the island?
Like that time I had selected the "20 messages moved to" message as well as the "haha it's a virtue" message. And the time before that, the "haha it's a virtue" message was the last one I had selected.
elsed with sed... read -rp "Say something: "; answer=$(echo "$REPLY" | sed -rn 's/[Mm]y name is (.+)/Hi \1/p;q'); echo "${answer:=I did not understand you}"
I'm making a bash script which presents a command line to the user.
The cli code is as this:
#!/bin/bash
cmd1() {
echo $FUNCNAME: "$@"
}
cmd2() {
echo $FUNCNAME: "$@"
}
cmdN() {
echo $FUNCNAME: "$@"
}
__complete() {
echo $allowed_commands
}
shopt -qs extglob
fn_hide_prefix...
I never used a computer with a cassette drive, of the kind Cassette BASIC used. My first programming language was Cassette BASIC because it was built into the BIOS of the 8088 IBM PC. When the machine failed t boot to disk, it booted into Cassette BASIC. This was when I was five.
@EliahKagan well, you don't need to match the whole line to print it, but since we need to match that phrase and select part of it I don't think there is a better way...
@EliahKagan that colourful page border is referencing the way the screen looked while the program was loading. You got a window in the middle telling you what was happening (hopefully) and around it (behind it) these lines scrolling and jumping around, red and green or blue and yellow. It made a godawful noise the whole time this was happening, and it took ages
why do we remember these devices so lovingly? haha
@EliahKagan oh you mean the error message... damn, I am really slow
No, no problem afaik! I think it's usual to use :a in the absence of a reason to use something else, and a is a command of course, and your Q is logical. I was only thinking of readability - I think it's a tiny bit distracting if the label is a command. But maybe worrying about the readability of a sed command is a waste of worry... If we wanted readability, we'd use another language haha
I think readability does matter. Part of what I'm hoping to convey is that even when bash has facilities that directly support an operation, and the operation isn't naturally a stream-editing operation, it's still often clearer, better, and more robust to use sed for it. So clarity would help with that. Plus, I even brought up clarity in the post, while advocating against the $'' way with \ns.