10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
here is what i want to achieve.. i have a file with below contents
cat fileName
blah blah blah
.
.DROP this
REJECT that
.
--sport 7800 -j REJECT --reject-with icmp-port-unreachable
--dport 7800 -j REJECT --reject-with icmp-port-unreachable
.
.
.
more blah blah blah
--dport 3306... (14 Replies)
Discussion started by: vivek d r
14 Replies
2. Shell Programming and Scripting
Sample file:
This is line one,
this is another line,
this is the PRIMARY INDEX line
l ;
This is another line
The command should find the line with “PRIMARY INDEX” and remove the last character from the line preceding it (in this case , comma) and remove the first character from the line... (5 Replies)
Discussion started by: KC_Rules
5 Replies
3. Shell Programming and Scripting
HI,
Im using the below commmand to delete lines having "(" at the start of a line.
sed -e '/^(/d'
But i need a command to delete lines that has only "(" in it and no other strings.
infile -
asdf
asdf
( asdf
(
asd
outfile (1 Reply)
Discussion started by: dvah
1 Replies
4. Shell Programming and Scripting
Hello. I'm trying to delete the lines of a file does not contain the letter "T " (for example) at position 26.
So far, I could only print the result:
awk '{if (substr ($ 1,1,26)! ~ / T /) print}' file.txt
How I can do to eliminate the lines that meet this condition?
Help please. ... (4 Replies)
Discussion started by: </kida>
4 Replies
5. Shell Programming and Scripting
I'm new to using sed and grep commands, but have found them extremely useful. However I am having a hard time figuring this one out:
Delete every line containing the word CEN and the next line as well.
ie. test.txt
blue
324 CEN
green
red
blue
324 CEN
green
red
blue
to produce:... (2 Replies)
Discussion started by: rocketman88
2 Replies
6. Shell Programming and Scripting
Please let me know wat would be sed command to delete any partcular line from a file and also moving lines below it to up.
ie wen line #9 is deleted data in line #10 should move to #9 and so on. (2 Replies)
Discussion started by: fidelis
2 Replies
7. UNIX for Dummies Questions & Answers
Alright, I'm sure there's a more efficient way to do this... I'm not an expert by any means. What I'm trying to do is search a file for lines that match the two input words (first name, last name) in order to remove that line. The removal part is what I'm struggling with. Here is my code:
echo... (4 Replies)
Discussion started by: lazypeterson
4 Replies
8. Shell Programming and Scripting
Hi,
I want to write a sed script which from
batiato:
batiato/giubbe:
pip_b.2.txt
pip_b.3.txt
pip_b.3mmm.txt
bennato:
bennato/peterpan:
123.txt
consoli:
pip_a.12.txt
daniele: (2 Replies)
Discussion started by: one71
2 Replies
9. UNIX for Advanced & Expert Users
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (1 Reply)
Discussion started by: rajan_san
1 Replies
10. Shell Programming and Scripting
Hi,
I need help with using an awk or sed filter on the below line
ALTER TABLE "ACCOUNT" ADD CONSTRAINT "ACCOUNT_PK" PRIMARY KEY ("ACCT_ID") USING INDEX PCTFREE 10 INITRANS 2 MAXTRANS 255 STORAGE(INITIAL 65536 FREELISTS 1 FREELIST GROUPS 1) TABLESPACE "WMC_DATA" LOGGING ENABLE
Look for... (2 Replies)
Discussion started by: rajan_san
2 Replies
delay(9F) Kernel Functions for Drivers delay(9F)
NAME
delay - delay execution for a specified number of clock ticks
SYNOPSIS
#include <sys/ddi.h>
void delay(clock_t ticks);
INTERFACE LEVEL
Architecture independent level 1 (DDI/DKI).
PARAMETERS
ticks The number of clock cycles to delay.
DESCRIPTION
delay() provides a mechanism for a driver to delay its execution for a given period of time. Since the speed of the clock varies among sys-
tems, drivers should base their time values on microseconds and use drv_usectohz(9F) to convert microseconds into clock ticks.
delay() uses timeout(9F) to schedule an internal function to be called after the specified amount of time has elapsed. delay() then waits
until the function is called. Because timeout() is subject to priority inversion, drivers waiting on behalf of processes with real-time
constraints should use cv_timedwait(9F) rather than delay().
delay() does not busy-wait. If busy-waiting is required, use drv_usecwait(9F).
CONTEXT
delay() can be called from user and kernel contexts.
EXAMPLES
Example 1: delay() Example
Before a driver I/O routine allocates buffers and stores any user data in them, it checks the status of the device (line 12). If the device
needs manual intervention (such as, needing to be refilled with paper), a message is displayed on the system console (line 14). The driver
waits an allotted time (line 17) before repeating the procedure.
1 struct device { /* layout of physical device registers */
2 int control; /* physical device control word */
3 int status; /* physical device status word */
4 short xmit_char; /* transmit character to device */
5 };
6
7
. . .
9 /* get device registers */
10 register struct device *rp = ...
11
12 while (rp->status & NOPAPER) { /* while printer is out of paper */
13 /* display message and ring bell */
/* on system console */
14 cmn_err(CE_WARN, "^ 07",
15 (getminor(dev) & 0xf));
16 /* wait one minute and try again */
17 delay(60 * drv_usectohz(1000000));
18 }
SEE ALSO
biodone(9F), biowait(9F), cv_timedwait(9F), ddi_in_panic(9F), drv_hztousec(9F), drv_usectohz(9F), drv_usecwait(9F), timeout(9F), untime-
out(9F)
Writing Device Drivers
SunOS 5.10 15 Oct 2001 delay(9F)