All Questions
Tagged with shell-script linux
1,944 questions
1
vote
1
answer
89
views
Process some Folders and format the output
In Linux there are some Folders.
I want to process each of this Folders with the program myprogramm.
I get a list with ls -1 or much better, sure only Folders with:
find . -maxdepth 1 -type d -printf '...
0
votes
2
answers
182
views
I have tried to install Howdy (practically Linux's Windows Hello). However, it seems like pypy3 failed to execute or something
I have tried to install Howdy, but it would always return with this message:
>>> Upgrading pip to the latest version
error: externally-managed-environment
× This environment is externally ...
0
votes
5
answers
187
views
Rename a set of files according to a specific scheme, with rename back option
In Linux in a directory there are files, ls -1 shows me this output :
file1.1-rvr
file1.2-rvr
file1.3
file1.4-rvr
file1.5
file1.6-rvr
file2.1
file2.2
file3.1
file3.10
file3.2-rvr
file3.3-rvr
file3.4
...
1
vote
2
answers
67
views
How to specify ELF shared objects in `LD_PRELOAD` if their path contains a space character?
Paths to ELF shared objects in LD_PRELOAD cannot contain spaces, as space is one of the two list separators, and it cannot be escaped:
LD_PRELOAD
A list of additional, user-specified, ELF shared ...
0
votes
2
answers
169
views
How to read a line of a file as a variable and then use it in a while loop?
I'm trying to have a script to read a line from a file and use it as a variable in a while loop and the variable switches for the next line of the text in the file; in addition, the while loop got ...
-3
votes
1
answer
133
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
97
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{...
-7
votes
2
answers
138
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 ...
-3
votes
1
answer
57
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
1
answer
58
views
Accessing a variable defined inside a sudo shell from outside
I'm trying to create a shell script with below requirement:
ssh to a RHEL server
sudo to an app user
delete the contents of a directory (/tmp/logs)
Copy the application logs from one directory (/app/...
-1
votes
1
answer
129
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 ...
4
votes
2
answers
706
views
Are Shell Script --long-options POSIX compatible?
In almost all POSIX specifications (e.g. ls), there are only short options (e.g. -A , -a , etc). In common shells like Bash, long options (e.g. --all , --almost-all , etc) are very common. And it is ...
-1
votes
1
answer
157
views
zip every month files and delete them [closed]
I have log patterns every day for artemis
I want to zip them and delete the files and save one month files in one zip
the files like this
artemis.log.2024-11-22
artemis.log.2024-11-23
artemis.log.2024-...
0
votes
4
answers
201
views
Clean up bash script
Can someone clean up this part of bin bash script for me? I feel like i can write this so much cleaner.
Basically, what i want to do is:
If $pluginexcl2 is defined that 2 different grep -v will be ...
2
votes
7
answers
787
views
Shell Script to Normalize the data
We have requirement to normalize the data ... Item field is comma delimited and irregular and it may have any items from 0 to max (lets say 100)
Input:
key1|desc field|item1,item2,item3,item4|extra ...