6 questions from the last 7 days
3
votes
2
answers
105
views
use while with multiple variables in the condition
When I add more than one variable in a while loop condition, the loop behaves unexpectedly.
cat script.sh
#!/bin/bash
string=Db6laokfKc
echo $string
klen=`echo -n "${string}" | wc -m` #10 ...
Best practices
0
votes
6
replies
91
views
using sed to replace multiple lines between two patterns
I have a file example.txt with the following content:
Begin of file
BEGIN
1
2
3
4
5
6
7
8
9
10
END
End of file
I want to replace every second line inside a matched space of sed. So I tired
cat ...
3
votes
3
answers
57
views
How to do console colors in bash script
I have a Bash script that prints status headers using ANSI color escape codes. The script runs, the output prints, but instead of seeing colored text, I see the literal escape sequences printed to the ...
0
votes
1
answer
49
views
Why doesn't ignore option for ls work in this instance? [duplicate]
I have a program like this (the indented lines can be run multiple times):
#!/bin/bash
options=""
options+=" --ignore={"
read pattern
options+='"'
options+="$...
0
votes
0
answers
58
views
How do I use the Terratest shell module? [closed]
I’ve been trying to use the Terratest shell module to execute bash commands, but I haven’t had much success. Documentation appears to be limited, and most references I found were via AI tools. Below ...
-5
votes
0
answers
46
views
How to unfreeze the terminal in VSCode after CTRL+S? [closed]
I want to disable Ctrl+S in VSCode.
It's not that I want to pass CTRL+Q to bash.
How to unfreeze the terminal in VScode after CTRL+S?