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?
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.
I'm learning the basics of shell programming, so I wrote something simple like
#!/bin/bash
read var1
read var2
if [ var1 -lt var2 ]; then
echo "var1 is lt var2"
else
echo "var2 is lt var1"
fi
My understanding is that variables are untyped in Bash, and that any variable may be used as an integer if it only contains digits.
Hi,
I just am make friend with scripting 2 weeks ago and has completely no idea how to search for the keyword to all the following syntax. Please help.
var1="${mode:-AUTO}"
Does this mean that the variable var1 is assigned with the pass-in argument? Then what does ':-AUTO' means?
var2="${mydate}_lock.text"
Hi,
I need a help with cut/awk command. I need to get certain values from a string provided.
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.
Hi All,
Need your inputs for the below.
I have 2 different servers 611 & 610, where i would be running two scripts.
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
Hello,
I usually search extensively and have to date found what I've needed. However, this one's got me stumped. I need to create a variable as follow. The issue however is that upon execution, it freezes. $var1 isn't always present in usage.log and this is fine but I'd like it to continue with the script if no match is found. Any ideas?