All Questions
583 questions
0
votes
0
answers
30
views
Where to set XDG_RUNTIME_DIR per user?
So I ran into the following interesting problem:
I tried to define XDG_RUNTIME_DIR in my .bashrc as follows:
export XDG_RUNTIME_DIR=$MY_HOME/.local/share
After doing this I noticed my pactl cli ...
0
votes
1
answer
43
views
RUNUSER && SU: pass env and run app, permissions trouble
I'm new to working with OS and unix, I'm trying to create separate users for an application, nginx, etc... and in order to run the process on their behalf. I'm currently debugging the following ways ...
0
votes
1
answer
32
views
bind -x with unicode codepoints
I instructed my terminal emulator to send "\u{85}" (C1 control character "NEXT LINE" (NEL)) down the pipe to be caught by bash:
bind -x '"\u0085":"echo Hello"'
...
7
votes
2
answers
1k
views
Having trouble with #!/bin/sh -h as the first line in a bash script: /bin/sh: 0: Illegal option -h
I have two systems, the file is the same. It works in openSuse, but having trouble in Ubuntu. The top of the script says: #!/bin/sh -h
I updated bash to match on both systems to match what is on ...
8
votes
3
answers
661
views
How can I make jq assign values to environment variables in one command?
Say, I provide jq with the following JSON body as input:
{"person1": {"name": "foo"}, "person2": {"name": "bar"}}
Is it possible to have jq ...
2
votes
1
answer
274
views
When trying to unzip file from script, I get Segmentation fault (core dumped)
I'm trying to unzip a file in a bash script, but I get a 'Segmentation fault (core dumped)' error following a repeated output message of 'Unzip agent files.'
Unzip agent files.
Unzip agent files.
...
0
votes
0
answers
65
views
bash jumplist like in vim
I want to remap bash ctrl + i / ctrl + o to jump between workdirs, meaning directories where after diving into them (with cd) I invoked other commands than a mere cd or ls. I think the easiest is ...
1
vote
1
answer
696
views
Bash script to start/stop ComfyUI
I'm trying to create a bash script and .desktop shortcut that toggle (start and stop) the ComfyUI server. This is my current working bash script to start the ComfyUI server:
#!/bin/bash
# activate ...
0
votes
0
answers
39
views
Not able to login to a user through another user in Vagrant
I have a main user scriptbox where all three other web01, web02, web03 are connected.
Web03 is an ubuntu based VM and other two are centos. They are running fine but web03 is not doing, it keep ...
0
votes
1
answer
59
views
how to get total and used memmory using special files in filesystem in linux?
How to use /sys/fs to get total memmory free and used size?
I know total memory of the process
cat /proc/$pid/smaps | grep -i pss | awk '{Total+=$2} END {print Total/1024/1024" GB"}'
the ...
0
votes
1
answer
73
views
How to ignore Error found when loading /home/(username)/.profile
I have some command in .profile that can fail or succeed, I don't care about the error, if it failed just ignore it. However, even if I put it in an if block and redirect its output to /dev/null, ...
0
votes
0
answers
53
views
Complex logical expression (wrong or as intended?) [duplicate]
I have a 3 part logic (A or B and C). Logically if A is true then true, or if B and C is true then true; But here is the error
if (A or B and C) -> should return true
if [ 1 -eq 1 ] || [ 2 -eq 2 ] ...
0
votes
1
answer
283
views
stdin redirection from /dev/tcp/localhost/port
I'm trying to get my head around some TCP-related topics, and have been experimenting:
The following works fine:
Process A: nc -l 12345 | wc -c
Process B: </dev/random head -c 1k > /dev/tcp/...
-1
votes
1
answer
60
views
How to untar with excluding one top level folder
I want to exclude the ".git" from untar, but without success.
Here is the folder structure:
mkdir -p /tmp/test
mkdir -p /tmp/test/.git/hi
touch /tmp/test/.git/foo.bar
touch /tmp/test/....
0
votes
1
answer
178
views
Debian network namespace isolation
I have an AppImage which I need to run 3 instances of, concurrently. Each instance will use it's own profile (Home directory). That's all very easy:
HOME=/home/user/home AppName.appimage
Now the ...