Category "shell"

How to read user interaction of rm -I command and store in a variable shell scripting

so this function basically runs similar to rm -i command and the arguments are passed while executing (eg. bash script_Name test.txt). rm -i $file does ask me t

Viewing command history in Google Cloud shell

I am trying to view some commands I used several months ago for a course project. I used the history command but it only showed very recent lines. Is there a wa

Adding platform in flutter engine shell

Any idea on adding new platform to flutter engine (inside shell/platform) like how samsung did for tizen Any documentations or suggestions please.

Script to create swap partition fails when running automatically

I am creating a cluster of machines in AWS (Amazon Linux 2) using terraform by utilizing the user_data argument under the aws_instance resource. Part of the scr

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