01-29-2009
If there is no rule you can use for automation, I suggest you just line up all substitutions like I stated above one after another for every pattern exchange.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I wanted to Replace if 20th Char is space then Replace by X ..
12345678901234567890
AAAA HEXW PROGRM01 (Ended by 3 Spaces ) Followed by junk(can be spaces als)
BBBB HEXW PROGRM01 A0121225001 (Ended by 3 Spaces)Followed by junk
I have Tired some thing of this sort ...
cat... (4 Replies)
Discussion started by: pbsrinivas
4 Replies
2. UNIX for Dummies Questions & Answers
One way I was told to do was incase strings in quotes.
But I was given this option if I can get it to work.
Will this work for splitting up SPF records?
I am try to make bx.example.com reference spf.eu.***, spfa.eu.***, spfb.eu.***, and spfc.eu.***.
spf.eu.example.com 3600 IN TXT "v=spf1... (0 Replies)
Discussion started by: tmanx
0 Replies
3. Shell Programming and Scripting
Hi
I m having ifconfig -a o/p like
sbanlab1:ksh# ifconfig -a | egrep "flags|inet" | awk -F' ' '{print $1,$2}'
lo0: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
inet 127.0.0.1
lo0:1: flags=2001000849<UP,LOOPBACK,RUNNING,MULTICAST,IPv4,VIRTUAL>
inet 127.0.0.1
bge0:... (1 Reply)
Discussion started by: tarunn.dubeyy
1 Replies
4. UNIX for Dummies Questions & Answers
Hi everyone.
I am a newbie to Linux stuff. I have this kind of problem which couldn't solve alone. I have a text file with records separated by empty lines like this:
ID: 20
Name: X
Age: 19
ID: 21
Name: Z
ID: 22
Email: xxx@yahoo.com
Name: Y
Age: 19
I want to grep records that... (4 Replies)
Discussion started by: Atrisa
4 Replies
5. Shell Programming and Scripting
Hi Gurus,
I need to cut single record in the file(asdf) to multile records based on the number of bytes..(44 characters). So every record will have 44 characters. All the records should be in the same file..to each of these lines I need to add the folder(<date>) name.
I have a dir. in which... (20 Replies)
Discussion started by: ram2581
20 Replies
6. Shell Programming and Scripting
file contents looks like this :
#START
line1 of record1
line2 of record1
#END
#START
line1 of record2
line2 of record2
line3 of record2
#END
#START
line1 of record3
#END
my question how should i make it a records between #START and #END .
willl i be able to get the contents of the... (5 Replies)
Discussion started by: sathish92
5 Replies
7. Shell Programming and Scripting
Hi All,
I am trying to split a record into multiple records based on a value.
Input.txt
"A",1,0,10
"B",2,0,10,15,20
"C",3,11,14,16,19,21,23
"D",1,0,5
My desired output is:
"A",1,0,10
"B",2,0,10
"B",2,15,20
"C",3,11,14
"C",3,16,19
"C",3,21,23 (4 Replies)
Discussion started by: kmsekhar
4 Replies
8. Shell Programming and Scripting
Hello,
I have some problem in counting char of word, sum and change. I'm not sure shell script can do this.
Input data:
Sam1 BB BB AA AA BB BB BB
Sam2 BB BB AA AA AB AB AB
Sam3 BB BB BB AA BB BB BB
Sam4 AB AB AB AB AB AB AA
Sam5 BB BB AA AA BB BB -- If I count in column 2, B is 9... (3 Replies)
Discussion started by: awil
3 Replies
9. UNIX for Dummies Questions & Answers
Hi everyone,
I've a requirement to modify an existing line which is common to multiple files. I need to replace that existing line with a new line. I've almost 900 ksh files to edit in the similar fashion in the same directory.
Example:
Existing Line: . $HOME/.eff.env (notice the "." at the... (3 Replies)
Discussion started by: kaleem.adil
3 Replies
10. Shell Programming and Scripting
I did help some at another forum to change one line to multiple lines.
var1="abc001: text goes here yyy003: text goes here uuuu004: text goes here"
Running this awk, gives correct result, but its not very nice. Any idea on how to simplify it?
awk '{for (i=1;i<=NF;i++) printf $i~":"?"\n"$i" ":$i"... (7 Replies)
Discussion started by: Jotne
7 Replies
HWDB(7) hwdb HWDB(7)
NAME
hwdb - Hardware Database
DESCRIPTION
The hardware database is a key-value store for associating modalias-like keys to udev-property-like values. It is used primarily by udev to
add the relevant properties to matching devices, but it can also be queried directly.
HARDWARE DATABASE FILES
The hwdb files are read from the files located in the system hwdb directory /lib/udev/hwdb.d and the local administration directory
/etc/udev/hwdb.d. All hwdb files are collectively sorted and processed in lexical order, regardless of the directories in which they live.
However, files with identical filenames replace each other. Files in /etc have the highest priority and take precedence over files with the
same name in /lib. This can be used to override a system-supplied hwdb file with a local file if needed; a symlink in /etc with the same
name as a hwdb file in /lib, pointing to /dev/null, disables that hwdb file entirely. hwdb files must have the extension .hwdb; other
extensions are ignored.
Each hwdb file contains data records consisting of matches and associated key-value pairs. Every record in the hwdb starts with one or more
match strings, specifying a shell glob to compare the lookup string against. Multiple match lines are specified in consecutive lines. Every
match line is compared individually, and they are combined by OR. Every match line must start at the first character of the line.
The match lines are followed by one or more key-value pair lines, which are recognized by a leading space character. The key name and value
are separated by "=". An empty line signifies the end of a record. Lines beginning with "#" are ignored.
In case multiple records match a given lookup string, the key-value pairs from all records are combined. If a key is specified multiple
times, the value from the record with the highest priority is used (each key can have only a single value). The priority is higher when the
record is in a file that sorts later lexicographically, and in case of records in the same file, later records have higher priority.
The content of all hwdb files is read by systemd-hwdb(8) and compiled to a binary database located at /etc/udev/hwdb.bin, or alternatively
/lib/udev/hwdb.bin if you want ship the compiled database in an immutable image. During runtime, only the binary database is used.
EXAMPLES
Example 1. General syntax of hwdb files
# /lib/udev/hwdb.d/example.hwdb
# Comments can be placed before any records. This is a good spot
# to describe what that file is used for, what kind of properties
# it defines, and the ordering convention.
# A record with three matches and one property
mouse:*:name:*Trackball*:
mouse:*:name:*trackball*:
mouse:*:name:*TrackBall*:
ID_INPUT_TRACKBALL=1
# A record with a single match and five properties
mouse:usb:v046dp4041:name:Logitech MX Master:
MOUSE_DPI=1000@166
MOUSE_WHEEL_CLICK_ANGLE=15
MOUSE_WHEEL_CLICK_ANGLE_HORIZONTAL=26
MOUSE_WHEEL_CLICK_COUNT=24
MOUSE_WHEEL_CLICK_COUNT_HORIZONTAL=14
Example 2. Overriding of properties
# /lib/udev/hwdb.d/60-keyboard.hwdb
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn*
KEYBOARD_KEY_a1=help
KEYBOARD_KEY_a2=setup
KEYBOARD_KEY_a3=battery
evdev:atkbd:dmi:bvn*:bvr*:bd*:svnAcer*:pn123*
KEYBOARD_KEY_a2=wlan
# /etc/udev/hwdb.d/70-keyboard.hwdb
# disable wlan key on all at keyboards
evdev:atkbd:*
KEYBOARD_KEY_a2=reserved
If the hwdb consists of those two files, a keyboard with the lookup string "evdev:atkbd:dmi:bvnAcer:bdXXXXX:bd08/05/2010:svnAcer:pn123"
will match all three records, and end up with the following properties:
KEYBOARD_KEY_a1=help
KEYBOARD_KEY_a2=reserved
KEYBOARD_KEY_a3=battery
SEE ALSO
systemd-hwdb(8)
systemd 237 HWDB(7)