Hi all! I think someone might be able to solve my problem pretty easily.
I am trying to run a bash loop with 3 variables.
Hi I am beginner in writing shell scripting please tell me how to compare a string in Unix shell.
i have two variables in a shell script,
Code:
var1="00101 00201 00301 303 401 405"
var2="101 201 301"
i want to compare var1 with var2 . for example if 101 from Var1 present in Var2 or not. similarly 201 of Var1 present in Var2.
Hi,
Into KSH, or AWK, I have a variable that contains undefined number of varX. who knows how much
Code:
MYVAR="var1|var2|var3..."
I would like to convert it to this format, that would ouput echo $mynewvariablecontent
Code:
'var1','var2','var3'
would you have the possible solution?
Hello everyone :)
I am trying to think of a logic where my file contains some data I had to read and do some processing. Issue is that file contains data multiple times. For example:
:::::::::::
var1=value1
var2=value2
:::::::::::
var1=value3
var2=value4
:::::::::::
I need to pass an argument from the command line to the "at" command.
I want "at" to run a script which requires a few arguments from the command line when it runs.
I am trying to run a small script - test - on ubuntu box.
It is as follows:
var1 = bash
var2 = /home/test/directory
...
...
<some more variable assignments and then program operations here>
...
...
Now every time I run it, then it throws errors:
root@localhost#/opt/test
/opt/test: line 1: var1: command not found
/opt/test: line 3: var2: command not found
...
...
more similar errors
.
Hi All,
Need your inputs for the below.
I have 2 different servers 611 & 610, where i would be running two scripts.
I'm writing a script and I would like to pass the results from bc into a variable. I've declared 2 variables (var1 and var2) and have given them values. In my script I want to pass the results from bc into another variable say var3 so that I can work with var3 for other calculations.
I have a file and i'd like to be able to read it, taking each line to a variable as dictated by the file:
structure:
var1:result1
var2:result2
var3:result3
I'd like each of these to represent
var1=result1
var2=result2
var3=result3
I think i know how to split these up using : as a seperator, but i'm not sure where to start on taking one of the elements as the variable name.
Cheers
Chris