9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
Can the below be clarified please. i just want to know what is the difference between the two ways of assigning variables as mentioned below.
export SRC_TBL=${SRC_TBL-"MMA_COPAY_PLN_FACT_STG"}
export SRC_TBL="MMA_COPAY_PLN_FACT_STG"
thanks in advance :)
Arun (1 Reply)
Discussion started by: Arun Mishra
1 Replies
2. Shell Programming and Scripting
Hi All,
Is it possible to grep for two files and assign their names to two separate variables with for loop? I am doing the below currently:
if
then
for fname in $( cd $dirA ; ls -tr | grep "^Ucountry_file$")
do
InFile=$dirA/$fname
... (4 Replies)
Discussion started by: swasid
4 Replies
3. Shell Programming and Scripting
i have variables RECIPIENTS_DEVL,RECIPIENTS_UACC,RECIPIENTS_PROD
i have a case statement to get the phase variable:
case ${WMD_UPHASE1} in
u) WMD_UPHASE4=UACC;;
i) WMD_UPHASE4=DEVL;;
p) WMD_UPHASE4=PROD;;
d) WMD_UPHASE4=DEVL;;
*) WMD_UPHASE4=DEVL;;
esac
I am unable to... (3 Replies)
Discussion started by: Arun Mishra
3 Replies
4. Shell Programming and Scripting
Hi Gurus,
I have a file named log with 2 lines
Each line is a file name. eg
$ cat log
monday
tuesday
I need to read log and assign each output(filename) to a different variable.
The following doesn't work:-
while read A B
do
echo " a is ${A} "
echo " b is ${B} "
done <... (6 Replies)
Discussion started by: wisdom
6 Replies
5. UNIX for Dummies Questions & Answers
Hi,
I am having a line which is separated by -
I need to extract each field and put into some variable.
a=`echo "this-is-the-case" | awk -F- '{print $1}' `
b=`echo "this-is-the-case" | awk -F- '{print $2}' `
c=`echo "this-is-the-case" | awk -F- '{print $3}' `
d=`echo "this-is-the-case" | awk... (2 Replies)
Discussion started by: posix
2 Replies
6. Shell Programming and Scripting
Hi GUYS,
I have function. I am assigning a line count to count variable. But it is throwing an error at this line.
function_recur (){
#file being created in this function
lenth = `wc -l function_outpu.dat`;
echo $lenth;
}
this is the error i got
rec.ksh: lenth: not found.
... (3 Replies)
Discussion started by: mac4rfree
3 Replies
7. UNIX for Dummies Questions & Answers
What am I doing wrong? I was searching for the answer to assigning variables from output. I found this simple response
ls -l apply_want.m | read perms links owner group size mtime1 mtime2 mtime3 file
this should allow me to echo the variables
echo "$perms | $links | $owner | $group |... (2 Replies)
Discussion started by: whamchaxed
2 Replies
8. Shell Programming and Scripting
I do a lot of command line scripting to capture data from files or other command output. I've checked in a number of Unix and scripting books but for the life of me I can't find out how to asign field data from nawk output into variables that I can manipulate later. For example, reading a two... (6 Replies)
Discussion started by: steveje0711
6 Replies
9. UNIX for Dummies Questions & Answers
Before I even attempt this, is it possible to grep for a pattern, maybe a partial sentence like "go to page 3", assign that to a variable and then use awk or something to pull out the 3 and assign it to a variable? So first I would have
Gotopg = "go to page 3"
then
page = 3 (9 Replies)
Discussion started by: k@ssidy
9 Replies