Category "bash"

Change indented multiline string in file in terminal

i want to change multiline string within particular marks that is indented in file, example looks like this: non_important_array: [ text ], impo

Can I pass a string variable to jq not the file?

I want to convert JSON string into an array in bash. The JSON string is passed to the bash script as an argument (it doesn't exist in a file). Is there a way o

Can I pass a string variable to jq not the file?

I want to convert JSON string into an array in bash. The JSON string is passed to the bash script as an argument (it doesn't exist in a file). Is there a way o

How to get the length of the sum of audio files using sox?

I have a script such as following DIR=$1 ls $1 |sort -R |tail -$5 |while read file; do soxi -d $1$file done and it gives me an output like 00:40:35.18 00:4

PowerShell script to SSH to Multiple Linux devices and restart/reboot them

I am comfortable with writing single queries. I am new to writing bash scripts trying to automate the daily stuff. I need help on creating a PowerShell or bash

Start a docker container from bash script and execute commands on it

I am having a problem running Fenics using their docker container: Background to this is: One main VM communicates with the user via a REST API and gets one or

How can i count number of directories in current folder?

I want to count the number of directories in each folder it traverses. If a number of folders are equal to one, continue traversing, else select the current fol

Bash - check if repository exists

I am trying to create if statement which will check if repository with name X exists, if it doesn't => create it. Made following code. It works, but when rep

execute a shell script from different folder in Python

I'm not a pythonist, just need to fix some script. So I'm want to run some Bash shell script that placed not in the same folder as the Python script but in one

execute a shell script from different folder in Python

I'm not a pythonist, just need to fix some script. So I'm want to run some Bash shell script that placed not in the same folder as the Python script but in one

Linux Bash to mysql: Select or delete record with external value

I have a MariaDB (mysql) database with a table which looks like this: MariaDB [DevicesPool]> show columns from Dirs_and_Names; +-----------------+-------

Is there any way to load FBX file using ARKit?

In my project I am projecting 3d files using ARKit. I am able to project .dae and .obj format models. Is there anyway I could load .fbx files?

Remove Files whit name '\' [duplicate]

I make mistake file with this name '' and i do not know how to clear this file How to remove the file with this name '' ? rw-r--r-- 1 root ro

Git bash giving error of warning: unable to rmdir

I am using git bash on windows 10 which was recently updated to creators update. whenever i am trying to switch between branches i get following thing $ git f

How to prompt the commands that are written in a text file previously for spike?

I am using Spike to run a RISCV CPU. I will write the same set of commands many times that I wrote below run 100 reg 0 run 100 reg 0 run 100 reg 0 I actually

Raspberry Pi - fbi process blocking Teamviewer

I might have a rare case, but at the moment I'm not able to find a solution for this problem. I've installed a RaspberryPi 3 in a local business to display imag

How to find file path to a bash file when the folder is renamed or moved to a new drive?

I've made an executable jar file for a terminal game that can be opened by typing java -jar name.jar in the Terminal. Then I made a .sh file inside the same fol

How to append json array using jq+shell in a loop?

I can create a json object with an array using jq like this echo '{"input":{"names":[]}}' | jq --arg val "alice" '.input.names[0] += $val'| jq --arg val "bob"

Extract string between combination of words and characters [duplicate]

I would like to keep the strings between (FROM and as), and (From and newline character). Input: FROM some_registry as registry1 FROM another_

How can I change the order of some string in a filename

I have lots of files like these: tf_CVBV6Z_CVSA1Z_pws2_pcc1.sac tf_CVBV5Z_CVSA2Z_pws2_pcc1.sac tf_CVBV4Z_CVSA3Z_pws2_pcc1.sac tf_CVBV3Z_CVSA4Z_pws2_pcc1.sac tf