Questions tagged [scripting]
A script is a sequence of commands or instructions that are executed by an interpreter program rather than compiled into a standalone executable program.
4,545 questions
-1
votes
1
answer
75
views
Creating in Linux files in GB or MB range by various size by read a file [closed]
In Linux with Bash, there is the File numbers_in_one_line.
In this file there is only one line with several numbers, all separated by spaces.
These numbers are the value in bytes for creating files ...
0
votes
1
answer
86
views
How to create splittet random files and join them with dmsetup
In Linux in Bash, there is a script, a part of the script is this
while true ; do
echo
awk -v x=$(<"$TEMPDIR"size_container_in_byte) -v n=$(<"$TEMPDIR"parts) 'BEGIN{...
3
votes
3
answers
300
views
Running a script based on raw events from a specific HID?
bit of a strange issue for you. I have an old 2-in-1 laptop tablet thing that works well enough, except the driver for the touchscreen occasionally crashes, leaving it unusable. I have a simple script ...
-7
votes
2
answers
93
views
How can I pick random items from a list, but some more often than others, in a Bash config file? [closed]
In Linux, using Bash, I have two scripts:
script.sh is the main script, and
script_config.sh is the configuration for script.sh.
In script.sh, I do source script_config.sh to load all the config ...
1
vote
1
answer
66
views
How can a bash script determine how it was started? [duplicate]
I am running various scripts on Debian 12.X currently with the following bash:
GNU bash, version 5.2.15(1)-release (x86_64-pc-linux-gnu)
I have the following methods/options to execute the script.
...
0
votes
2
answers
91
views
Bash script, execute while command isnt outputting value
I'm trying to write a bash script (very new to writing them btw) on a Linux system, and I basically want it to execute a command every say 5 seconds while another command isn't outputting a value.
So ...
-3
votes
1
answer
50
views
Rename files, remove the first four signs [duplicate]
There are many files in this format:
IMG_20240717_191421.jpg
IMG_20240620_165358_BURST001_COVER.jpg
IMG_20240624_173513_2.jpg
how can they renamed in Linux in Bash to:
20240717_191421.jpg
...
0
votes
5
answers
128
views
Move/mark files and the associated-part too
There is a folder with many files in it:
112.mkv
123.md5
123.mkv
221.mkv
467.mkv
aa1.mkv
abc.md5
abc.mkv
bbc.mkv
dde.md5
dde.mkv
ggh.mkv
....
xxy.md5
xxy.mkv
xxz.mkv
How can I move .md5 files and the ...
1
vote
2
answers
65
views
How automatically open a URL after rebooting in a Debian desktop?
How automatically open a URL after rebooting on a Debian desktop?
1- Running the command by terminal:
xdg-open http://homeassistant.local:8123
OK it works and opens the URL above
2- creating any ...
6
votes
4
answers
577
views
get chain of users created by chaining su calls
While administrating a linux server (a Debian server, for instance), I often switch users. Sometimes, I will chain multiple user switches together:
aluriak$ sudo -s
root$ […]
root$ su aluriak
aluriak$ ...
0
votes
0
answers
18
views
HTPC: Xbox Controller binding home button to Script and original function
Situation: I have a HTPC running Nobara linux (flavor of Fedora) and I have an Xbox controller that is connected to it and will wake it from sleep.
Problem: HDMI-CEC is not supported by my hardware. ...
-1
votes
1
answer
72
views
Best tool to convert xlsx to csv
I need to install something that allow me through a script bash or if I can do it without install any external tool it would be great.
The thing is I read about csvkit but is a tool of python and i ...
-1
votes
2
answers
67
views
set output into variable from grep from input variable
whats wrong with this bash script:
acme2=$(dig txt @$1 _acme-challenge.$1.de)
acme3=$(echo $acme2 | grep "^_acme") ...
1
vote
1
answer
178
views
Patch line receives error
I have a script and patch that I took somewhere to compile an image (linux build root) and I added some lines and now I got one error during patch, the error is like that:
diff --git a/package/base-...
0
votes
1
answer
75
views
I need to run script on remote server which require root access using sshpass and its failing
I need to run script on remote server which require root access using sshpass and its failing with eror script not found. I ran below command.
sshpass -frhelpass ssh user@IP 'echo mypass | sudo -S &...