Hi there,
I was trying to add a line of text in the middle line of a file.
I have counted the lines in the file, and then I divide it into 2, after that I am stuck on how am I suppose to append the line on that file? When I tried to use this command 'second line >> filename' it appends it at... (3 Replies)
Hi all,
I have set up a simple awk script to calculate the average of values that are printed out a number of times per second (the number of time the printing occurs varies). The data is of the format shown below:
1 4.43
1 3.65
1 2.45
2 7.65
2 8.23
2 5.65
3 4.65
3 6.21
.. ..
120... (4 Replies)
Hi
New to shell script and awk and need assistance on this problem. I need to use a variable to substitute a string in an external file and write the changed info to another file.
At first I did not know if you could use a variable as the sub value but the following showed me that I can.
... (3 Replies)
Hi, I have a very simple script like below:
for n in 10 20 30
do
for a in 30 40 50 60 70 80
do
for r in 2 3 4 5 6 7
do
m=$((r*a))
count=1
while
do
echo "a = " $a ", m = " $m ", n = " $n
... (2 Replies)
Hello;
Trying to figure out how to keep just the contents between the two search lines:
awk '/regexp_1/ ,/regexp_2/'
I do not want lines containing regexp_1 and regexp_2 in the output.
Thank you for any ideas
Video tutorial on how to use code tags in The UNIX and Linux Forums. (5 Replies)
Hello;
I need to print two previous lines after searching for a reg exp:
awk '/haywood/'
should produce the following
===================
p9J46THe020804 89922 Tue Oct 18 21:06 MAILER-DAEMON
(host map: lookup (haywood.com): deferred)
... (1 Reply)
Hi there, Im sure there is a simple explanation for this but I have a file like this with no balnk lines
peter
paul
john
I run the command
# var=`grep paul file.txt`
# echo $var
paul
# echo $var | wc -l
1
but when I grep for a value that isnt in the file, i still... (4 Replies)
Hello;
we have :
awk '/reg_exp/,0/
prints every line after the first occurrence of "reg_exp"
But if I want to print rest of the lines AFTER the last occurrence of "reg_exp",
how would I do it ??
Tried :
awk ' ! (/reg_exp/,0)'
But it errored...
Thank you for any... (5 Replies)
Discussion started by: delphys
5 Replies
LEARN ABOUT DEBIAN
hal-lock
HAL-LOCK(1) General Commands Manual HAL-LOCK(1)NAME
hal-lock - lock an interface
SYNOPSIS
hal-lock [options]
DESCRIPTION
hal-lock can be used to acquire a lock on a given interface either on a given device or globally. For more information about both the big
picture and the semantics of HAL locks, refer to the HAL spec which can be found in /usr/share/doc/hal-doc/spec/hal-spec.html depending on
the distribution.
OPTIONS
The following options are supported:
--interface
The name of the interface to lock.
--run Program to run if the lock was acquired.
--udi The UDI (Unique Device Identifier) of the device object. If this is ommitted, the global lock will be tried.
--exclusive
Whether the lock can be held by others.
--exit-with-lock
Kill the program if the acquired lock is lost. This only makes sense if you pass a specific UDI due to the semantics of HAL locks.
--exit-with-dev
Kill the program if the device is removed. This only makes sense if you pass a specific UDI due to the semantics of HAL locks.
--help Print out usage.
--version
Print the version.
RETURN VALUE
This program will attempt to grab a lock on a given interface. Unless, a specific UDI is given, the global lock will be tried. If the
lock was succesfully acquired the program specified by the option --run will be run and upon termination this program will exit with exit
code 0. If the lock wasn't acquired or an error occured while taking the lock, this program will exit with a non-zero exit code and the
given program will not be run.
NOTES
This program is only useful for launching software that doesn't use HAL at all (since such software launched using hal-lock would be locked
out itself); for example a partition table editor part-foo may use wrapper script like this
hal-lock --interface org.freedesktop.Hal.Device.Storage --exclusive --run /path/to/part-foo-program
BUGS
Please send bug reports to either the distribution or the HAL mailing list, see http://lists.freedesktop.org/mailman/listinfo/hal on how to
subscribe.
SEE ALSO hald(8), lshal(1), hal-get-property(1), hal-set-property(1), hal-find-by-property(1), hal-find-by-capability(1)AUTHOR
Written by David Zeuthen <david@fubar.dk> with a lot of help from many others.
HAL-LOCK(1)