You need to use an array. The following is a bash array example.
Arrays start counting at 0 (zero), so an array of three words has 3 elements: word1 word2 word3
word1 is 0, word2 is 1, word3 is 2....
reference the elements you want and assign them to variables. I used your example to assign the variables.
This User Gave Thanks to jim mcnamara For This Post:
hey people..
i have a configuration file that looks like
7080 7988
net04.xxxxx.edu
20
where 20 is the number of threads in the thread pool initially.
net04.xxxxx.edu is the hostname.
and 7080 7988
are two ports. first one for client requests and second one for dns communication. now my... (2 Replies)
Hi ,
I have a piece of code ...wherein I need to assign the following ...
1) A command line argument to a variable
e.g origCount=ARGV
2) A unix command to a variable
e.g result=`wc -l testFile.txt`
in my awk shell script
When I do this :
print "origCount" origCount --> I get the... (0 Replies)
Hi ,
I am new to shell scripting (ksh shell) and trying to accomplish few requiremtns.
I have a file with the following format
EMP NO EMP NAME AGE Amt Paid
12 Mark Taylor 32 32333
14 James Brown... (5 Replies)
Hi! I'm trying to assign line numbers to each line of the file
for example consider the following..
The contents of the input file are
hello how are you?
I'm fine.
How about you?
I'm trying to get the following output..
1 hello how are you?
2 I'm fine.
3 How about you? ... (8 Replies)
Hi ,
I am trying to write an shell, which reads a text file (from a location) having a list of numbers of strictly 5 digits only ex: 33144
Now my script will check :
1) that each entry is only 5 digits & numeric only, no alphabets, & its not empty.
2)then it executes a shell script called... (8 Replies)
Friends
I need to have a shell script which will feed variables from two different files line-by-line. For example, I have two files - permission and file_name.
Contents of permission is -
644
755
....
contents of file_name
/file1
/file2
.....
Now I want 644 permission will be... (4 Replies)
Hey guyz,
I have a table which shows the presence or absence of my variables (A,B,C,...) in my observations (1,2,3,...)
* A B C ...
1 1 0 1
2 1 1 0
3 1 0 0
...
I want to calculate the co-presence of my variables. to have a table shows the pairwise presence of the variables (have... (1 Reply)
I've got a file that looks like this (spaces before first entries intentional):
12345650-000005000GL140227 ANNUAL HELC FEE EN
22345650-000005000GL140227 ANNUAL HELC FEE EN
32345650-000005000GL140227 ANNUAL HELC FEE EN
I want to read through the file line by line,... (6 Replies)
Hi All,
Am trying to write wrapper shell/bash script on a utility tool for which i need to pass 2 files as arugment to execute utility tool.
Wraper script am trying is to do with above metion 2 files.
utility tool accepts :
a. userinfo file : which contains username
b. item file : which... (2 Replies)
Discussion started by: Optimus81
2 Replies
LEARN ABOUT DEBIAN
pydhcplib.strlist
pydhcplib.strlist(3) PYDHCPLIB pydhcplib.strlist(3)NAME
pydhcplib.strlist - Internal type of pydhcplib for lists of bytes processing.
SYNOPSIS
from pydhcplib.type_hw_addr import hwmac
a = strlist()
a = strlist([100,100,10,42,44,26])
DESCRIPTION
The class pydhcplib.strlist is an specific type of pydhcplib. It exist in order to simplify processing of raw data from network. When a
dhcp packet dhcp is received, it's a succession of approximately 300 bytes. Within pydhcplib these data are transformed in an intermediary
form of type "strlist" in order to facilitate their handling. This intermediary form will eventually be suppressed in the stable versions
of pydhcplib to speedup the processing time, but backward compatibility will be assured.
The pydhcplib.strlist class creation argument can be a list of numbers whose value goes from 0?55.
The pydhcplib.strlist class creation argument can be a string of ASCII character.
METHODS
The implemented methods in this type are mostly comparison methods (= =, >, etc...)
else :
str() convert the address into a printable string type.
list() convert the address into a list of bytes.
EXAMPLES
Example program strlist_example.py :
from pydhcplib.type_strlist import strlist
word = strlist()
word1 = strlist("azerty")
word2 = strlist("qwerty")
word3 = strlist([97, 122, 101, 114, 116, 121])
print "a0 : ",word
print "a1 : ",word1
print "a2 : ",word2
print "a3 : ",word3
if word1 == word2 :
print "test 1 : ",word1, "==",word2
else :
print "test 1 : " ,word1, "!=",word2
if word1 == word3 :
print "test 2 : ", word1, "==",word3
else :
print "test 2 : ", word1, "!=",word3
SEE ALSO pydhcp(8), pydhcplib.hwmac(3), pydhcplib.ipv4(3), pydhcplib.strlist(3), pydhcplib.DhcpPacket(3), pydhcplib.DhcpBasicPacket(3), pydhc-
plib.DhcpNetwork(3), pydhcplib.DhcpClient(3), pydhcplib.DhcpRawClient(3), pydhcplib.DhcpDerver(3)BUGS
See http://pydhcplib.tuxfamily.org/ for more information.
AUTHOR
Mathieu Ignacio (mignacio[AT]april.org)
pydhcplib.strlist(3)