Most active questions
73 questions from the last 7 days
3 votes
3 answers
874 views
How do I ensure a bash script argument is a specific value?
The following script is supposed to check $1 and see if it is a specific value. It only works when one Bash [[... =~ ...]] regex check is passed in an if statement. The error is: When more than one ...
0 votes
1 answer
743 views
Why is this FAT filesystem recording access time?
FAT isn't meant to record file access time, but the FAT filesystem I have in a VeraCrypt container file does. Why is this? This was before I opened the file /run/media/veracrypt1/test: ~ $ stat /run/...
7 votes
4 answers
476 views
How to separate start directories and expression in `find`?
find takes an (optional) list of (what the man page calls) "starting points", i.e. directories, followed by an expression. Is there a way to cleanly separate both types of arguments so that ...
7 votes
2 answers
632 views
Why does crontab use a wrong editor?
man crontab reads: The -e option is used to edit the current crontab using the editor specified by the VISUAL or EDITOR environment variables. After you exit from the editor, the modified ...
3 votes
5 answers
186 views
How can I use sed to chain append lines from a text file, add it as a suffix to the text on the same lines numbers on another file, and so on?
I've tried using sed for this. I've tried putting the lines of interest in variables as well. I have two examples I want to achieve for now. Lets say I have thousands of urls in a file called links....
8 votes
1 answer
365 views
What is the USER= value reported for sudo attempts?
On my Arch system, failed attempts to run sudo cause a line like this to be added to the logs (note the USER=root): Nov 20 14:59:31 oregano sudo[191472]: bob : user NOT in sudoers ; TTY=pts/26 ; ...
4 votes
3 answers
294 views
Headless disk-mount with user permissions
There is a headless machine, with Debian as its OS: $ cat /etc/issue Debian GNU/Linux 11 \n \l $ uname -a Linux mymachine 6.1.99 #33 SMP Tue Jan 21 11:32:39 CST 2025 aarch64 GNU/Linux What I wish to ...
4 votes
1 answer
179 views
Choice of field separator affects sort's ordering
Suppose we have a script named test_sort in our $PATH with the following contents: #!/bin/bash function echo_text () { printf -- "%s\n" "$fc$oc$fs$lc" printf -- "%s\n&...
4 votes
2 answers
127 views
How to resize ext4 without adding more inodes?
On this filesystem, there are enough inodes already, I only need more filesystem size: # df -i Filesystem Inodes IUsed IFree IUse% Mounted on /dev/mapper/spinning-backup ...
0 votes
2 answers
58 views
How to replace all `[` and `]` in sed?
Logical way would be to use an 's/[\[\]]/_/g' regexp replace, however it does not work as intended to. It replaces a chain of [ and ] with a single _. $ echo 'x[]x'|sed -E -e 's/[\[\]]/_/g' x_x $ echo ...
2 votes
1 answer
197 views
Replacing the domain string in the compiled binary file with an IP address
Just in theory: is it possible to replace the domain string in the compiled binary file with an IP address by editing a binary file in place with sed? (IP address belongs to a different domain, but ...
1 vote
2 answers
143 views
How changing the terminal letters color and its whole background at the same time, using separate RGB or color codes?
It's often that when I am in a subject involving many processes of two or three kinds, I'm noticing that: one terminal I've opened is dedicated for my subject of kind #1, while another is opened to ...
0 votes
2 answers
131 views
Process sed capture group with a bash function before replacement: "sh: 1: <bash function>: not found"
So, I was playing around with this answer, when I found that neither printf_stdin () { read input printf "$input" } sed "/lorem ipsum foobar/ { s/'/'\"'\"'/g s/\...
3 votes
1 answer
95 views
Wine cmd automatically escapes quotes, adds backslash
$ wine cmd /c 'echo "hello world"' \"hello world\" Where do the backslashes come from? The command behaves differently in an interactive session: $ wine cmd Microsoft Windows 6.1....
-1 votes
1 answer
55 views
Is RAM + SWAP > 4GB possible on arm32?
On x86, the solution would be either PAE, but yet better is to use a 32-bit system with a 64-bit kernel. The physical memory of the planned 32-bit ARM system is only 3GB. I would like to increase it, ...