10 More Discussions You Might Find Interesting
1. UNIX for Beginners Questions & Answers
hi,
I am using hp unix server and not getting variable output present inside the while loop. I have tried changing the code and need to verify whether it is proper practice of code. I am expecting the output of varible RUN_FILE 3 to TRUE which i get inside the while loop.
RUN_FILE 1=TRUE... (8 Replies)
Discussion started by: gowthamsoft
8 Replies
2. UNIX for Beginners Questions & Answers
Thanks all for taking time out and reading this thread and big Thanks to all who have come forward for rescue.
Background: I have a variable "nbrofcols" that has number of columns from a data file. Now, using this count in for loop, I am trying to get the maximum length of each column present... (7 Replies)
Discussion started by: svks1985
7 Replies
3. Shell Programming and Scripting
Hi,
Was hoping someone could help with the following:
while read line; do pntadm -P $line | awk '{if (( $2 == 00 && $1 != 00 ) || ( $2 == 04 )) print $3,$5}'; done < /tmp/subnet_list
Anyone know if it is possible to assign $3 and $5 to separate variables within the {} brackets?
Thanks... (14 Replies)
Discussion started by: CiCa
14 Replies
4. 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
5. Shell Programming and Scripting
So, in awk, I've always put my variable assignments inside of the curly braces, just like dad, and grandpa, and the 26 generations before them. But today I came upon an awk statement that had them outside the braces-- blasphemy!
Seriously, though, is there any practical difference? I was... (3 Replies)
Discussion started by: treesloth
3 Replies
6. Shell Programming and Scripting
Hi all
I run my program prog.c in the following way :
$ ./prog 1 > output.txt where 1 is a user defined initial value used by the program.
But now I want to run it for many a thousand initial values, 1-1000, and store all the outputs in different files.
Like
$ ./prog 1... (1 Reply)
Discussion started by: alice06
1 Replies
7. Shell Programming and Scripting
hi all,
i am experiencing an error which i think an incorrect syntax for the where clause passing a variable was given. under is my code.
sqlplus -s ${USERNAME}/${PASSWORD}@${SID} << END1 >> $LOGFILE
whenever sqlerror exit
set serveroutput on size 1000000
declare
l_rc ... (0 Replies)
Discussion started by: ryukishin_17
0 Replies
8. Shell Programming and Scripting
Hi Gurus
I have a file called /tmp/CMDB which looks like this
serial: 0623AN1208
hostname: server1
model: x4100
assetID: 1234
I am writing a for loop that will go through this file line by line creating a variable of itself. Using the first iteration of the loop (i.e. the first line) as... (6 Replies)
Discussion started by: hcclnoodles
6 Replies
9. Shell Programming and Scripting
Guys I am trying to assignthe values to variables from a for loop.
s1:/tmp> for i in `cat test`
> do
> echo $i
> done
Sdosanjh
2
6
Now, I want is
NAME=Sdosanjh
CURRENT=2
SPECIFIED=6
there are multiple lines in the "test" file.
So next time when for loop picks values from next... (1 Reply)
Discussion started by: sdosanjh
1 Replies
10. IP Networking
hello guyz,
I am working on project of automatic ip adress assignment to a local network
when I send a packet with Mac adress I want to get a reply from the other machine
with its ip address ,so how can I achieve that? (2 Replies)
Discussion started by: netsavy
2 Replies