Skip to content

Tag: bash

Piping two command from makefile is not working

I use the following commands in my makefile in the commands im getting array of values and remove the array [] from it, I want to run this command in my terminal and I use the following fzr provide apps | (subst ],,$(subst [,,$(apps))) | $(apps) and I got error what am I missing here ? if I run only

ls sort order inside container

Running ls -d to list directories, print directories in different order if trailing / is present in file name. Why is that? What sorting rules apply? and why does this happen only with docker? With trailing / Without trailing / Answer I found out I get the same behavior using sort command But the sorting orde…

Replacement of PS1 variable in .bashrc using Sed or Perl

I am trying to replace a line in file and am running in to issues. Original File: Command I am running: Error message: I also tried sed: Result with Sed: Expected Result File: End Result This doesn’t have much to do with the question except to show folks what the PS1 will look like when working properly…

bash script unable to ask confirmation

I am initiating myself to shell scripting and I need to ask the user about confirmation. I have this script, which I don’t know why the following command is not working: read -p “Are you sure about this action?” yn I use it twice, at the beggining of the script and in the middle. The first r…

Export Curl information to file using sed

I am trying to get a dns address using curl and I would like to use that dsn address to replace a word in a .js file. So the .js file contains a word “hostname” and I would like to replace that with the dns address fetched from curl so what I am trying to do is this. sed ‘s/hostname/curl

Bash get docker image ID automatically

I’m trying to run a few docker commands in my linux machine: But I would like to make a runme.sh and execute all in one run. The problem is that ImageID bf46cff9b182 is dynamiccally changing everytime. So I need to somehow pipe it from the output of the load command, which is in fact possible. The outpu…