10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hello,
Could anyone please help me with Assigning a value to variable and then updating the value in the original file
IFS='|'
while read -r Serial_ID JOB_NAME STATUS
do
if
then
echo "Perform Fuctions"
???Assign STATUS to COMPLETED and Update File???
done <File (7 Replies)
Discussion started by: infernalhell
7 Replies
2. Shell Programming and Scripting
Hi All
I am trying to fetch the size of three files into three separate variables within a for loop and am doing something like this:
for i in ATT1 ATT2 ATT3
do
size_$i=`ls -ltr $i | awk '{print $5}'`
echo ${size_$i}
done
but am getting the below error:
ksh: size_ATT1=522: not... (3 Replies)
Discussion started by: swasid
3 Replies
3. Shell Programming and Scripting
for var in {1..3}
do
lspci -nn |awk -v i=$var '/8086:10a7/{split($1,a,""); print "0x"a}'
done
it will output
0x01
0x00
0x1
I want to let bus=0x01 slot=0x00 fun=0x1, How to modify this loop?
I know it can be get by
bus=`lspci -nn |awk... (4 Replies)
Discussion started by: yanglei_fage
4 Replies
4. Shell Programming and Scripting
Hello All,
Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....?
I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping
through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies
5. Shell Programming and Scripting
Hi, I was wondering if anyone could assist me for (what is probably) a very straightforward answer.
I have input files containing something like
File 1
Apples
Apples
Apples
Apples
File 2
Bananas
Bananas
Bananas
Bananas (4 Replies)
Discussion started by: hubleo
4 Replies
6. Shell Programming and Scripting
Hello Guys,
I have a small loop problem as below.
I have 3 different values to be used while running the same script -
va1="some-value1"
va2="some-value2"
va3="some-value3"
Now I want to use these three variable values to be used for running the same command, like -
while... (1 Reply)
Discussion started by: rockf1bull
1 Replies
7. Shell Programming and Scripting
cs1=`echo "scale=8;($css1/$css0)*100"|bc`
cs2=`echo "scale=8;($css2/$css0)*100"|bc`
cs3=`echo "scale=8;($css3/$css0)*100"|bc`
cs4=`echo "scale=8;($css4/$css0)*100"|bc`
cs5=`echo "scale=8;($css5/$css0)*100"|bc`
cs6=`echo "scale=8;($css6/$css0)*100"|bc`
cs7=`echo "scale=8;($css7/$css0)*100"|bc`... (3 Replies)
Discussion started by: thulasidharan2k
3 Replies
8. Shell Programming and Scripting
The situation is like this:
I am reading records from a file, depending upon some condition extracting fields from the file into different variables in a loop one by one. I need to print all the variable in line, so I am trying to redirect hose variables one by one to a variable called final_value... (1 Reply)
Discussion started by: mady135
1 Replies
9. Shell Programming and Scripting
I have a set of variables:
f1="./someFolder"
.
.
f10="./someOtherFolder"
And I'm trying to use the following loop
for (( i = 0; i <= 10; i++ ))
do
temp=f$i
done
I'm trying the get the values from my set of variable to make directories, but I can't seem the get those value... (3 Replies)
Discussion started by: kriuz
3 Replies
10. UNIX for Dummies Questions & Answers
Hi,
I have file abc.txt which has keys and emails addresses
abc.txt
emailkey1:sam@abc.com
emailkey1:tom@abc.com
emailkey2:rqw@abc.com
emailkey2:tut@abc.com
I have a shell script where i pass key as the parameter and i want all the email addresses within that key concatenated by a comma... (21 Replies)
Discussion started by: samit_9999
21 Replies