Skip to main content

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.

-4votes
0answers
47views

Creating in Linux files in GB or MB range by various random size by read a file [closed]

In Linux in Bash i have this script (thanks to Ed Morton) . $ cat ./tst.sh #!/usr/bin/env bash while read -r idx sfx size; do echo fallocate "file${idx}.${sfx}" "$size" done &...
user447274's user avatar
-2votes
1answer
107views

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 ...
user447274's user avatar
0votes
1answer
87views

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{...
user447274's user avatar
3votes
3answers
304views

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 ...
Gridzbi Spudvetch's user avatar
-7votes
2answers
93views

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 ...
user447274's user avatar
1vote
1answer
66views

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. ...
ReflectYourCharacter's user avatar
0votes
2answers
91views

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 ...
Tamrak's user avatar
-3votes
1answer
50views

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 ...
user447274's user avatar
0votes
5answers
128views

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 ...
user447274's user avatar
1vote
2answers
65views

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 ...
carlos rother's user avatar
6votes
4answers
577views

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$ ...
aluriak's user avatar
0votes
0answers
19views

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. ...
Fader's user avatar
-1votes
1answer
72views

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 ...
user714955's user avatar
-1votes
2answers
67views

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") ...
dg1kpc's user avatar
1vote
1answer
178views

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-...
James78's user avatar

153050per page
close