Ubuntu – Echo -e on MacOS
I have a problem with printing signs n. My script is make for bash and is set to posix=yes. When I ran program on Mac the printing to bash is done only by echo "text here". But when I ran…
I have a problem with printing signs n. My script is make for bash and is set to posix=yes. When I ran program on Mac the printing to bash is done only by echo "text here". But when I ran…
I need to manage domain names (fqdn), printing all of them somewhere, possibly in a file csv. All infos are in apache conf files, I need to associate all the domain name with ip and port. This is the sample…
I have a bash script: #! usr/bin/env bash # test bash script to call python scripts cd ~/python for ((i = 1; i <= 2; i++)); do python3 test_0$i.py; done cd ~/bash that pulls test_0x.py files from the python directory…
In a bash shell, I want to convert an array variable $a into a string of tab separated values. I found a very complete answer by F.Hauri, using IFS, but then I could not make it work in a script.…
I have a problem with mysqldump that might be solved by configuring mysqldump differently, but probably will be solved by just piping the output through a shell script. Basically, mysqldump always outputs the tables in the same order, but it…
I'm writing a bash script that populates a configuration file and it needs to get the Java version and vendor. I read that the best way to get the Java vendor is to run java -XshowSettings:properties -version. My plan is…
I am trying to sort arrays in MongoDB shell. This seems to be the only syntax available to use. db.products.updateOne({"name": "ben"}, {$push: {"hobbies": {$each: [], $sort: -1}}}) My question is that, is there no other way to do this -…
This is the problem and, why am I not getting output as Today is date(24/01/2024) pls resolve this, and explain why am I not getting date in the below command ? [email protected]:~$ date | echo "Today is" Today is I…
I'm relative new to Bash and i'm trying to clean things up and have a better folder structure. I'm currently trying to build a script that have options up and down like the famous command "Docker-Compose Up" & "Docker-Compose Down"…
S_1004_DKDL220006264-1A_HLGLFDSX3_L4_cleaned_1_fastqc.html S_1004_DKDL220006264-1A_HLGLFDSX3_L4_cleaned_1_fastqc.zip S_1004_DKDL220006264-1A_HLGLFDSX3_L4_cleaned_2_fastqc.html S_1004_DKDL220006264-1A_HLGLFDSX3_L4_cleaned_2_fastqc.zip S_1006_DKDL220006298-1A_HKFTLDSX3_L1_cleaned_1_fastqc.html S_1006_DKDL220006298-1A_HKFTLDSX3_L1_cleaned_1_fastqc.zip S_1006_DKDL220006298-1A_HKFTLDSX3_L1_cleaned_2_fastqc.html above are the name of the files in a folder. I want to remove between second _ from right and second _ from left. So that the output looks like S_1004__1_fastqc.html S_1004__1_fastqc.zip S_1004__2_fastqc.html…