10 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
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
3. Shell Programming and Scripting
I wrote a simply perl that searched a file for a particualr value and if it found it, rite it and the next three lines to a file. Now I have been asked to check those next three lines for a different value and only write those lines if it finds the second value.
I was thinking the best way to... (1 Reply)
Discussion started by: billprice13
1 Replies
4. Shell Programming and Scripting
I have a file that has four values on each line and I'd like to give each column a variable name and then use those values in each step of a loop. In bash, I believe you could use a while loop to do this or possibly a cat command, but I am super new to programming and I'm having trouble decoding... (2 Replies)
Discussion started by: ccorder22
2 Replies
5. Shell Programming and Scripting
Hi,
In a script i am having trouble joining a variable to a file. for, example I read input from user as a variable a or b or c or d etc and want to join those to different files...
or
if user press a then it will open somefile.txt
if user press b then it will open otherfile.txt
any idea (4 Replies)
Discussion started by: Learnerabc
4 Replies
6. Shell Programming and Scripting
I was trying to store the number of lines in a file and store it in a file.after that i want to store the information in a file to a variable which is further used in the if loop to check certain condition.
#!/bin/bash
cat <file> | wc -l > count.txt
x="$count.txt";
i=10;
if ; then
cat... (10 Replies)
Discussion started by: sudhakaryadav
10 Replies
7. 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
8. UNIX for Dummies Questions & Answers
HI
I have something like this in a file
ABC = 1
DEF = 2
GHI = 3
JKL = 4
MNO = 5
QRS = 6
TUV = 7
I need to assign ABC to V_abc (that is to a variable)
GHI to V_ghi (that is to another variable)
TUV to say V_tuv
... (6 Replies)
Discussion started by: ssuresh1999
6 Replies
9. Shell Programming and Scripting
I am missing something here, I have a file which contains only one line and that is either a number or character string. I am trying to read the file and assign that value to a variable and here it seems I am missing something and not getting the expected results... Here is the code :
#!/bin/ksh... (2 Replies)
Discussion started by: Vaddadi
2 Replies
10. 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