03-03-2013
Well the problem with this, and sorry I left it out, Im piping live data into AWK then printing to a file. I appreciate the attempt, but unfortunately I need to pipe it in and pipe out live.
8 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I have an awk basic question.
file.text
Our Location:
Our home has light yellow siding,
and is a duplex on Main Street,
across from the High School,
and across the lane from the Health Center
If I run:
cat file.txt | awk '{print $2}' | grep... (7 Replies)
Discussion started by: research3
7 Replies
2. UNIX for Dummies Questions & Answers
I have a script problem that I am not able to solve due my very limited understanding of unix/awk.
This is the contents of test.sh
awk '{print $1}'
From the prompt if I enter:
./test.sh Hello World
I would expect to see "Hello" but all I get is a blank line. Only then if I enter "Hello... (2 Replies)
Discussion started by: JasonHamm
2 Replies
3. Shell Programming and Scripting
I find an script with awk sitting around. I went through some online manuals, but I can't figure out exactly how it works. I can't post the whole program. Not allowed.
This is the line that is confusing me. I get when else is in the script
grep -v "^REM " $1| grep -v "JUNK;" | awk -F" "... (2 Replies)
Discussion started by: guessingo
2 Replies
4. Shell Programming and Scripting
Here's a basic awk program I am trying to run. It shows no error but shows no result either too. If someone can look up and tell me what's wrong I will be obliged.
Thanks. :)
Code Snippet.
#!/bin/bash
awk '{
for (i = 1 ; i <= 3 ; i++)
for ( j = 1 ; j <= 3 ; j++ ) {
... (2 Replies)
Discussion started by: mr.amitkc
2 Replies
5. UNIX for Dummies Questions & Answers
Hi,
Sorry if this is a newbie question. I guess you can use either awk or shell script for this sequence of operations, but knowing very little about either of them I'm not sure how I should try to write this.
The basic objective is to copy certain files that are scattered all over my... (10 Replies)
Discussion started by: pc2001
10 Replies
6. UNIX for Dummies Questions & Answers
Hi,
I was trying to change the value of the 4th column (put '1' in the 4th column of each row). My awk command is:
awk -F, '{$3=1;}1' OFS= input.txt > ./test_out.txt
My input file is:
a 1 2 31
b 4 5 61
c 7 8 91
My output file (test_out.txt)is:
a 1 2 31
b 4 5 61
c 7 8 91
What... (4 Replies)
Discussion started by: pc2001
4 Replies
7. UNIX for Dummies Questions & Answers
input:
Name|Operation
rec_10|1+2+2-
Output:
rec_10|1
Basically I am trying to calculate the result of "the path" in $3 where the operators follow the number and not preceding them like we normally do:
rec_10: +1+2-2=1
But I realise (I am sure there is a good reason for that) that awk... (7 Replies)
Discussion started by: beca123456
7 Replies
8. Shell Programming and Scripting
1. increase file space
first, double space a file:
awk '1;{print ""}'
I probably can understand it:print a blank line every time.But when I read triple space a file I am confused:
awk '1;{print "\n"}'
doesn't it meaning print a blank line every time too?
2. number each line of file, but... (6 Replies)
Discussion started by: hhdzhu
6 Replies
LEARN ABOUT SUNOS
usb_pipe_get_private
usb_pipe_set_private(9F) Kernel Functions for Drivers usb_pipe_set_private(9F)
NAME
usb_pipe_set_private, usb_pipe_get_private - USB user-defined pipe data-field facility
SYNOPSIS
#include <sys/usb/usba.h>
int usb_pipe_set_private(usb_pipe_handle_t pipe_handle, usb_opaque_t data);
usb_opaque_t usb_pipe_get_private (usb_pipe_handle_t pipe_handle);
INTERFACE LEVEL
Solaris DDI specific (Solaris DDI)
PARAMETERS
For usb_pipe_set_private():
pipe_handle
Pipe handle into which user-defined data is placed.
data
Data to store in the pipe handle.
For usb_pipe_get_private():
pipe_handle
Pipe handle from which user-defined data is retrieved.
DESCRIPTION
The usb_set_driver_private() function initializes the user-private data field of the pipe referred to by pipe_handle, using data. The
user-private data field is used to store any data the client desires and is not used in any way by the USBA or OS framework. Client driv-
ers often store their soft-state here for convenient retrieval by their callback handlers.
The usb_get_driver_private() function retrieves the user-private data stored via usb_set_driver_private(), from the pipe referred to by
pipe_handle.
RETURN VALUES
For usb_pipe_set_private():
USB_SUCCESS
Private data has been successfully stored in pipe handle.
USB_INVALID_PIPE
pipe_handle argument is NULL or invalid.
Pipe is closing or closed.
USB_INVALID_PERM
The pipe_handle argument refers to the default control pipe.
For usb_pipe_get_private():
On success: usb_opaque_t pointer to data being retrieved.
On failure: NULL. Fails if pipe handle is NULL or invalid. Fails if pipe handle is to a pipe which is closing or closed.
CONTEXT
May be called from user, kernel or interrupt context.
EXAMPLES
usb_pipe_handle_t pipe;
/* Some driver defined datatype. */
xxx_data_t *data = kmem_zalloc(...);
usb_pipe_set_private(pipe, data);
----
xxx_data_t *xxx_data_ptr = (xxx_data_t *)usb_pipe_get_private(pipe);
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Architecture |PCI-based systems |
+-----------------------------+-----------------------------+
|Interface stability |Evolving |
+-----------------------------+-----------------------------+
|Availability |SUNWusb |
+-----------------------------+-----------------------------+
SEE ALSO
attributes(5), usb_pipe_open(9F), usb_alloc_request(9F)
SunOS 5.10 5 Jan 2004 usb_pipe_set_private(9F)