Sponsored Content
Full Discussion: cut or nawk
Top Forums Shell Programming and Scripting cut or nawk Post 302675553 by capilla on Monday 23rd of July 2012 09:20:48 AM
Old 07-23-2012
Thanks but doesn't work
Code:
root@SERVER01:/opt/scripts\ > nawk '/busti/ && match($8,/(\/[^\/]*){5}/) {print substr($8,RSTART,RLENGTH)}' ruta2.txt
root@SERVER01:/opt/scripts\ >
root@SERVER01:/opt/scripts\>vi ruta2.txt
/SERVER01-01/=user/a3/85/=USER1
/SERVER01-01/=user/a3/85/=USER1/=+Eliminats
/SERVER01-01/=user/a3/85/=USER1/=+Enviats
/SERVER01-01/=user/a3/85/=USER1/=+Esborranys
/SERVER01-02/=user/c6/30/=USER2
/SERVER01-02/=user/c6/30/=USER2/=+Eliminats
/SERVER01-02/=user/c6/30/=USER2/=+Enviats
/SERVER01-02/=user/c6/30/=USER2/=+Esborranys
/SERVER01-02/=user/84/60/=USER3
/SERVER01-02/=user/84/60/=USER3/=+Eliminats
/SERVER01-02/=user/84/60/=USER3/=+Enviats
/SERVER01-02/=user/84/60/=USER3/=+Esborranys

 

6 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

how to access values of awk/nawk variables outside the awk/nawk block?

i'm new to shell scripting and have a problem please help me in the script i have a nawk block which has a variable count nawk{ . . . count=count+1 print count } now i want to access the value of the count variable outside the awk block,like.. s=`expr count / m` (m is... (5 Replies)
Discussion started by: saniya
5 Replies

2. Shell Programming and Scripting

Nesting - two nawk into one nawk

hi people; this is my two awk code: nawk '/cell+-/{r=(NF==8) ? $4FS$5FS$6 : NF==7 ? $4FS$5 : $4 ;c=split(r,rr);for (i=1;i<=c;i++){if(rr != "111111"){printf($3" %d ""\n",(i+3))}}printf("")}' /home/gc_sw/str.txt > /home/gc_sw/predwn.txt nawk -F'*' '{gsub(/ *$/,"")}$0=$1$($NF-2)'... (2 Replies)
Discussion started by: gc_sw
2 Replies

3. Shell Programming and Scripting

Cut Command error cut: Bad range

Hi Can anyone what I am doing wrong while using cut command. for f in *.log do logfilename=$f Log "Log file Name: $logfilename" logfile1=`basename $logfilename .log` flength=${#logfile1} Log "file length $flength" from_length=$(($flength - 15)) Log "from... (2 Replies)
Discussion started by: dgmm
2 Replies

4. Shell Programming and Scripting

Nawk Problem - nawk out of space in tostring on

Hi.. i am running nawk scripts on solaris system to get records of file1 not in file2 and find duplicate records in a while with the following scripts -compare nawk 'NR==FNR{a++;next;} !a {print"line"FNR $0}' file1 file2duplicate - nawk '{a++}END{for(i in a){if(a-1)print i,a}}' file1in the middle... (12 Replies)
Discussion started by: Abhiraj Singh
12 Replies

5. UNIX for Beginners Questions & Answers

Cut command: can't make it cut fields

I'm a complete beginner in UNIX (and not a computer science student either), just undergoing a tutoring course. Trying to replicate the instructions on my own I directed output of the ls listing command (lists all files of my home directory ) to My_dir.tsv file (see the screenshot) to make use of... (9 Replies)
Discussion started by: scrutinizerix
9 Replies

6. Shell Programming and Scripting

Using :<<cut / cut to comment out block of bash script

I am using : << cut / cut to comment out block of code. Works fine on few lines of script, then it gives me this cryptic error when I try to comment out about 80 lines. The "warning " is at last line of script. done < results 169 echo "END read all positioning parameters" 170... (8 Replies)
Discussion started by: annacreek
8 Replies
audio_support(7I)						  Ioctl Requests						 audio_support(7I)

NAME
audio_support - audio driver support routines and interface SYNOPSIS
#include <sys/audio.h> DESCRIPTION
The audio support module supports audio drivers that use the new audio driver architecture. It also provides a limited number of ioctl(2) functions for application programmers. DATA STRUCTURES
The following data structures are defined to manage the different audio device types and channels. Device Types The following enumeration lists a number of generic device types. typedef enum { UNDEFINED, AUDIO, AUDIOCTL, USER1, USER2, USER3 } audio_device_type_e; Currently, the Solaris audio mixer implements only the AUDIO and AUDIOCTL audio device types. See the mixer(7I) manual page for details. The USER1, USER2 and USER3 device types allow third parties to write audio personality modules of their own. Channel Structure This structure is used to get and set state information on individual channels. struct audio_channel { pid_t pid; /* application's process ID */ uint_t ch_number; /* device channel */ audio_device_type_e dev_type; /* device type */ uint_t info_size; /* size of channel's */ /* info structure */ void *info; /* channel state information */ ; typedef struct audio_channel audio_channel_t; The ch_number must specify the specific channel number to get or set. When the ioctl() returns, the pid contains the process ID of the process that has that channel open and dev_type will contain the device type. If pid is 0 (zero), then the channel is not open. The pointer *info must point to a buffer large enough to hold whatever audio device-related state structure that may be returned. Currently, only the audio_info_t structure is returned. See the audio(7I) and mixer(7I) man pages for more information. IOCTLS
The audio support driver provides the following ioctls(): AUDIO_GET_CH_NUMBER This ioctl() returns the channel number pointed to by the file descriptor. It is returned in the integer pointer of the ioctl() argument. AUDIO_GET_CH_TYPE This ioctl() returns the type of channel the process has open. It is returned in the audio_device_type_e enumeration pointer of the ioctl() argument. AUDIO_GET_NUM_CHS This ioctl() returns the number of channels the device supports. It is returned in the integer pointer of the ioctl() argument. MACROS
The following macro can be used to initialize data structures. The established convention is that the state corresponding to a field set to -1 will not be modified. AUDIO_INIT(I, S) Where I is a pointer to an info structure and S is the size of that structure. The following code segment demonstrates how to use this macro: audio_info_t info; AUDIO_INIT(&info, sizeof(info)); info.play.port = AUDIO_HEADPHONE; err = ioctl(audio_fd, AUDIO_SETINFO, &info); ERRORS
EINVAL The ioctl() is invalid for this file descriptor. The audio_channel_t structure's info pointer does not point to a buffer, or the ch_number is bad. ENOMEM The ioctl() failed due to lack of memory. FILES
/usr/share/audio/samples Audio sample files ATTRIBUTES
See attributes(5) for a description of the following attributes: +-----------------------------+------------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | |Architecture |SPARC, x86 | |Availability |SUNWaudd, SUNWauddx, SUNWaudh | |Stability Level |Evolving | +-----------------------------+------------------------------+ SEE ALSO
ioctl(2), attributes(5), audio(7I), mixer(7I), streamio(7I) FUTURE DIRECTIONS
Over time, additional audio personality modules will be added. Audio application programmers are encouraged to review this man page with each Solaris release for new audio personality modules. SunOS 5.10 2 January 2002 audio_support(7I)
All times are GMT -4. The time now is 06:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy