All Questions
Tagged with variable-substitution linux
7 questions
0
votes
1
answer
26
views
Error in defining Variables
I am trying to follow this to replace a multiline text.
But to do that I want to put some text like below into a variable.
```dataview
TABLE WITHOUT ID page-no as no, link(file.name, topic) as name ...
0
votes
2
answers
1k
views
Export a value from input variable
I need to export the values from input. However it's failing in bash.
Here's the code -
echo "Please enter HOST :"
read RDSHOST && export RDSHOST
And my value is something like - ...
1
vote
1
answer
2k
views
Substitute variable inside another variable in shell script without reassignment
I am trying to substitute a variable inside another variable in shell script. but its showing as empty string. Below is the scenario.
Assigning "x" with string containing variable "abc"
~$ x="new ...
1
vote
2
answers
654
views
bash + how to define array variable with instance number
Is it possible to define variable that is called for example machine1 as machine$counter ( while counter=1 ) ?
For example, I created the /tmp/config.txt file and set the machine1 as array:
$ more /...
1
vote
1
answer
88
views
Inserting variables in a file path on GNU linux (SLES 11)
I am tryin to insert 3 variables to build a path, but unable to get it .
I am trying the below
log_path="/vol02/logs/$dname/logs/103602_$msname/${msname}_start.log"
dname=cfp
msname=cfp003
i get ...
5
votes
1
answer
15k
views
when to use double quotes with a variable in shell script? [duplicate]
I am in a confusion with what is meant by the double quotes referring to a variable. For example following two scripts gives the same output. What is really meant by the double quotes?
Script1
...
2
votes
1
answer
491
views
shell variable in awk is not being passed to all the lines but just for the very first line of input?
inputfile:is2.txt
10.39.5.41,A1,B1
10.39.5.41,A2,B2
10.39.5.41,A3,B3
10.39.5.41,A4,B4
10.39.5.41,A5,B5
10.39.5.41,A6,B6
script :
#!/bin/bash
second_column="OOOOOOO" # OOOOOOO will be added to ...