Can't pass a variable representing the output of lsb_release to a docker dontainer
I don't know why, but the rendering of my code mucks up the spacing and indentation, despite being correct in the original file. I'm having issues getting the following script to run (specifically the nested script at the end of the docker command near the end of the script; I think I'm not passing the `lsb_release` variable correctly as an argument to the called `create_rpc_rs.sh` script, but I don't know how to correctly do so):
This is create_rpc_rs.sh:
This is the output when running `./regen_proto_structs.sh`, as you can see, `lsb_release` is not found, and I don't know how to correctly pass it Ii.e. the output of lsb_release -si on the computer that docker is runnning on, to the docker container.:
Unfortunately I posted this at a bad time as I need to stop working for the day.
Last edited by James Ray; 07-10-2018 at 08:57 PM..
Please become accustomed to provide decent context info of your problem.
It is always helpful to carefully and detailedly phrase a request, and to support it with system info like OS and shell, related environment (variables, options), preferred tools, adequate (representative) sample input and desired output data and the logics connecting the two including your own attempts at a solution, and, if existent, system (error) messages verbatim, to avoid ambiguities and keep people from guessing.
Thanks for applying the required code tags, but don't (over)use formatting and colouring, leaving the result nearly unreadable.
Just guessing: the first code shown is regen_structs_proto1.sh, and the second is create_rpc_rs.sh? Would have been nice to have pointed out in the first place.
Your juggling with shells and "shebangs" is sort of inconsistent, use bash throughout, or use sh, consistently. That might also be the source of the error: sh doesn't provide the [[ "conditional command".
For your ultimate question: export a variable to make it accessible in subshells / scripts.
Thanks. I have ditched this approach to modifying these scripts as per comments from the maintainers of the project. "I'm not sure we want to complexify the scripts, as these scripts are not meant to be run as long as you don't modify the .proto files."
Hello All,
I had recently learnt a bit of Docker(which provides containerization process).
Here are some of my learning points from it.
Let us start first with very basic question:
What is Docker:
Docker is a platform for sysadmins and developers to DEPLOY, DEVELOP and RUN applications ... (7 Replies)
Hi,
I have some 2000 names in a table like below.
Java
Oracle/SQL
ANSI SQL
SQL,DWH,DB
DB&Java
And by using for loop in my code i am able to get a single word but if there is any special character or space then it is considering as a next line.
I have to execute the below queries in... (10 Replies)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
2. Relevant commands, code, scripts, algorithms:
#! /bin/ksh
v="ORG_ID"
... (2 Replies)
Hello All,
Hope you're doing well !
I am trying below command to be passed in a shell script, header_date_14 is a variable and $1 is the name of a file I intend to pass as a command line argument, however command line argument is not being accepted.
header_date_14=$(m_dump... (8 Replies)
Hi,
I have a problem with passing a echo output into a variable in bash
file='1990.tar'
NAME='echo $file | cut -d '.' -f1';
echo $NAME
the result is
echo $file | cut -d . -f1
however with this one,#!/bin/bash
file='1990.tar'
echo $file | cut -d '.' -f1
the result is what I... (2 Replies)
Hi all,
Hereby wish to have your advise for below:
Main concept is
I intend to get current directory of my script file.
This script file will be copied to /etc/init.d.
A string in this copy will be replaced with current directory value.
Below is original script file:
... (6 Replies)
Hello again :)
Am currently trying to write a function which will delete a record from a file.
The code currently looks as such:
function deleteRecord() {
clear
read -p "Please enter the ID of the record you wish to remove: " strID
... (2 Replies)
Hello ,
i am on linux,
and im trying to figure out why my cp command cant copy one file.
I am trying to use variable in which i stored path to location where is file i wish to copy.
$ echo $ORA_ALERT_LOG
/u01/app/oracle/diag/rdbms/ring11/ring11/trace
$
$
$ pwd
/home/oracle
$ cp -p... (2 Replies)
Hi there!
I'm trying to write a script that will capture output from a command and assign it to a variable.
Let's say, for example, I'd like to catch from inside the script whatever the following command outputs:
ls *.aaa
and put it into a variable "listoffiles".
What I tried was:
set... (3 Replies)