Category "shell"

Pass parameter from list in file

i'm struggling with this topic: I've a file with a list of IDs, something like this: 34 23 478 12579 342356 On the other side, i've a command that i want to ru

Need some clarity on shell-script for Docker setup on Phoeinx project

I found below shell-script(entrypoint.sh) from some GitHub Phoenix repo and I saw the same code in multiple Phoenix projects #!/bin/bash # Wait until postgres

How to separate files, number wise using regular expressions in java/shell?

I want to separate below numbers like as(00 to 04, 10 to 14, 20 to 24) 00000000000 00000000001 00000000002 00000000003 00000000010 00000000011 00000000012 00000

shell scripting nested loops. How to run inner loop along with the parent loop [duplicate]

I have two log files with the application names and the failed reasons , first.log Application 01 Application 02 Application 03 Applicatio

Get current script location in Nu shell

In bash you can use $0 variable to get the location of the current script. How I do the same in Nu? echo $nu doesn't seem to have anything I can use.

How to handle JMESPath contains filter on attribute that may be null?

I want to filter the output from the Azure CloudShell command az ad sp list which outputs a JSON array, eg by filtering to Publisher Name = "ACME". All az comma

How to fix command not found in Linux shell scripting [duplicate]

I have a Linux shell script with the below code #! /bin/bash echo $BASH name = Mark echo $name When I run the script, I'm getting an error:

how to use -exec on the find command with xonsh?

In xonsh I can run a find command like this: find @(str(path)) -iname "log.txt" Where path is a pathlib.Path object. However, I don't understand how to use the

How to fix command not found in Linux shell scripting [duplicate]

I have a Linux shell script with the below code #! /bin/bash echo $BASH name = Mark echo $name When I run the script, I'm getting an error:

Identify the files year wise and delete from a dir in unix

I need to list out the files which are created in a specific year and then to delete the files. year should be the input. i tried with date it is working for me

How to find the amount of time taken during Iterative loop?

Trying to subtract two times down to the nanosecond in shell. declare start function handler() { count=$1 if [ "$1" -le 0 ]; then echo "Not a valid entry"

Copying and pasting code into the Nodejs REPL using shell script

I want to copy a javascript code snippet into Nodejs REPL using shell script. For example sum.sh node // Here REPL open, I want copy below codes to this REPL

How to only show output from shell script that is running as a service?

I write a shell script and installed it on systemctl to run on startup, everything works fine, however if i run "systemctl status myservice" it shows all my scr

Create json from shell script output

I have a shell script version.sh in which i have code like. #!/bin/sh data = `lsb_release -a` echo $data it returned me the output like: Distributor ID: Ubuntu

Failed to capture the error message in linux

Failed to capture the response for the below command; URL="https://gsdfdsfithub.com/gitexpert/testGithub.git" > /dev/null git ls-remote $URL -q if [ $? -n

Open a new terminal tab and run a command inside, only after open tab

I'm trying to create a script to open a new tab at my rails project and run rails s inside this tab, to already start my server. My command: xfce4-terminal --ta

Convert text to associative array in bash script [closed]

Hi I am new to bash scripting. I have a text as shown below input = {'A': '1' 'B': '2' 'C': 'Associative_Array'} I want to convert the above t

Run a command but stay in the shell vs exit

I know that in vim I can type :terminal <command> % to run a command on the file in the current edit buffer. For example and to simplify what I want to d

How to wait in bash script to subprocess, if one of them failed so stop everyone

How to wait in bash script to subprocess and if one of them return exit code 1 so I want to stop all subprocess. This is what I tried to do. But there are a som

app.shell_context_processor decorator does not register the function as a shell context function

I created the following function in a microblog.py file in my ~/Programing/Rasa/myflaskapp/app folder. It creates a shell context that adds a database instance