Thanks for taking the trouble to reply.
If anyone can think of any easy way to do what I want to do then let me know.
Curently traawling through the mountain of find and replace postings on the forum.
Simply open file, find Word in line then replace word1 with word2. Then write change to file.
Word is a unique field in file so will only exist on one line. Word1 will only be present once per line.
cheers
Nick
Where address finds you the line, then pat1 is replaced by pat2. Only occurs once per line.
Last edited by de_la_espada; 08-01-2009 at 12:19 PM..
Reason: Found Solution
I have a little script to help me manage a gallery of image files. It makes symbolic links to every file in and below the current directory, placing them in a target directory which is passed to the script as a parameter. Unfortunately, the script pukes when I pass a parameter that contains... (4 Replies)
If have
var='$variable'
how can I expand $variable.
I have tried many thing like duble quotes/braces etc, but nothing worked.
I need the solution ASAP. (2 Replies)
Ummm can anybody help me with this one?
Its prob quite simple.
I bascially have a file name say J1x2x3x7.dat
Im using the file name as a variable in a bash script. Want I want to do is extract most of the file name and make it a new variable expect with say one of the number now a... (2 Replies)
I have some troubles with variables and quotes...
I want:
if $URL is empty (no user input) go to http://www.localhost/index.php/ else add this string (search) "?s=+$URL"
EXAMPLE:
No user input
string= http://www.localhost/index.php/
User input = "unix"
string=... (3 Replies)
Hi Guys,
I have an issue with awk and variables. I have trawled the internet and forums but can't seem to get the exactt syntax I need.
I have tried using awk -v and all sorts of variations but I have hit a brick wall. I have spent a full day on this and am just going round in circles.
... (3 Replies)
Sometimes it is handy to protect long scripts in C++.
The following syntax works fine for simple commands:
#define SHELLSCRIPT1 "\
#/bin/bash \n\
echo \"hello\" \n\
"
int main ()
{
cout <<system(SHELLSCRIPT1);
return 0;
}
Unfortunately for there are problems for:
1d arrays:... (10 Replies)
My OS is Linux (kernel 4.08.something) and AIX (7100-04-01-1543), the used ksh versions are:
ksh88: Version M-11/16/88f (AIX)
ksh93: Version M 93t+ 2009-05-01 (AIX), Version M 93u (Linux)
When writing a parser for stanza files in ksh i encountered a rather strange behavior. Here is a... (4 Replies)
I pass an argument to bash as run. The first command in green executes as expected, however the second in blue fails as the $run does not expand. I tried to escape the variable with \ thinking the quotes were making the literal translation and also "${run}" but both did not work to expand the... (3 Replies)
Hi Guys,
I wrote a collection of bash functions years ago and now need to use them again but
I'm getting some error messages when eval tries to expand the variables names.
I recollect that I used the shopt command to set one of the options but I can't quite
remember the command that I... (8 Replies)
Discussion started by: ASGR
8 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)