156,694 questions
1
vote
1
answer
36
views
Why is variable not expanding in jq?
Why does this work (variable expanded by bash)
jq -r "include \"i3\";stack(.id==$ID)|
.[]|select(.type==\"workspace\")|.name" <<< "$TREE"
When this ...
-7
votes
0
answers
56
views
Remote server ssh, bash freeze [closed]
I have been trying to log into a remote server with ssh and it seems to freeze every time I attempt to log in. I get into the server, and get the "welcome message", but then bash doesn't ...
Best practices
0
votes
3
replies
109
views
Bash PS1 containing Sixels
PS1 has either $(cat arch_prompt.sixels) or $(chafa arch_prompt.png) so I get that garbled mess. Sed doesn't work. The image gets garbled and doesn't work if it's removed, but as you see the small ...
Advice
0
votes
11
replies
143
views
How should I grab raw pixel data from a .png file (using Bash)?
I've been looking into making a script that grabs the raw pixel data from a .png file & writes it directly to the framebuffer, but how would I actually grab the data? I know PNG files have a bunch ...
Best practices
0
votes
4
replies
70
views
Deno and jq : invoke jk from Deno or from a bash script?
I would like your opinion and pros and cons of calling a bash command (in this case jq) from within a Deno program or writing a script that runs the Deno program followed by the jq command.
FYI, the ...
-3
votes
0
answers
58
views
Run Konsole, Split, and Focus with one shortcut [closed]
I am using Fedora KDE Plasma Wayland. I am very new to this. In Fedora 43, I was on X11 and the script below worked perfectly.
The thing I am trying to accomplish is when I hit Meta + Return;
- If ...
Advice
1
vote
6
replies
154
views
Linux Command line: grep -e or -E?
I'm curious about the behavior difference between '-e' and '-E'.
I sometimes do a command similar to this
myapp | grep -e "FIRST|SEOND|THIRD"
And sometimes I do a
myapp | grep -e "FIRST&...
1
vote
2
answers
119
views
Python subprocess with WSL and bcftools not returning awk output
I am building a Flask-based bioinformatics dashboard on Windows using WSL (Ubuntu). I am trying to execute bcftools commands through Python subprocess and calculate statistics from a VCF file.
The ...
1
vote
2
answers
168
views
How do I hide root files in git sparse-checkout cone mode?
I am using git sparse-checkout in --cone mode to optimize a massive monorepo:
git sparse-checkout init --cone
git sparse-checkout set /infrastructure/terraform /services/api
Nested directories ...
Advice
0
votes
2
replies
111
views
Linux USB bind/unbind
Assume that I have a USB drive plugged into my Linux (Debian) system and that the drive has been ejected via the ‘eject’ button from the desktop interface.
I am writing a Bash script to allow the ...
Best practices
0
votes
3
replies
82
views
Elegantly replace file inline when a redirect is needed
I have currently got this working (command that requires > is from https://askubuntu.com/a/1527714/1721740):
y="$(cat<<EOF
13pLj7wS3CyX31YDTmz4j5Y2bMtX6HY7z
EOF
)"
gdown "$y&...
0
votes
0
answers
47
views
Why does Bash substring slicing on BASH_REMATCH corrupt UTF-8 text in a Systemd service but work perfectly in the terminal? [duplicate]
I am running a Bash script that parses a log file, extracts a specific localized string using native regex matching ([[ $line =~ $pattern ]]), and then truncates the result to a maximum of 15 ...
3
votes
3
answers
163
views
Rexexp fails when in Bash script
There is a string I've extracted from a zip file:
866275 2016-02-06 11:25 Documents/familystuff/Household/Agri Stuff/Sheep/sheep Photos/2014 ewe lambs/074Cleo 6Feb16a.jpg
I want the first field (...
2
votes
1
answer
142
views
diff v3.12: option --from-file seems to be buggy
I found an issue with diff v3.12 and option --from-file, system OpenSUSE tumbleweed.
If I use command diff FILE1 FILE2 FILE3 --from-file OTHER-DIR/ (with and without trailing slash), only FILE1 is ...
Advice
0
votes
6
replies
126
views
Capture stderr while passing stdout to a pipe
My question is similar to How can I pipe stderr, and not stdout?
The following captures ALL the output from the cat command in a variable
_output="$(cat "$_filename" 2>&1)"
...