Sponsored Content
Top Forums Shell Programming and Scripting How to filter out major and minor? Post 302349429 by Vi-Curious on Tuesday 1st of September 2009 04:13:40 AM
Old 09-01-2009
Code:
echo proj_name/module/trunk/module_1_0 | perl -nle '{if (/.*_(\d+)_(\d+)/) {print "major=$1\nminor=$2"}}'

 

9 More Discussions You Might Find Interesting

1. Programming

Device Major/Minor numbers

To further my fledgling knowledge of C, I am re-writing some of the Unix command set. My current command is an ls-style command. All works well, except for device files. How do I get the major/minor numbers for the dev files? I see from the stat struct there are st_rdev and st_dev members. Do... (1 Reply)
Discussion started by: zazzybob
1 Replies

2. Solaris

major & minor number

Hi Can anyone tell me what is major number and minor number in the mknod command. Also what these numbers mean. I have gone through the man pages but still I couldn't understand. Regards (3 Replies)
Discussion started by: RajaRC
3 Replies

3. Shell Programming and Scripting

sort major.minor.release_build_x

would like to order this input based on major.minor.release AND build number Label abc_def_0.0.3_build_999 2008/08/01 'Created by me.' Label abc_def_0.0.9_build_1000 2008/08/01 'Created by me.' Label abc_def_9.0.9_build_10001 2008/08/01 'Created by me.' Label abc_def_10.9.100_build_2... (4 Replies)
Discussion started by: gurpal2000
4 Replies

4. Solaris

Help with Major and minor number

Hi Does anyone know what the major and minor numbers are in Solaris? (2 Replies)
Discussion started by: wisdom
2 Replies

5. AIX

how do I change major-minor numbers of disk devices

Good evening ... does anyone of you know how to change major/minor numbers of disk devices ? I had to migrate from raid1 to raid5 and this messed up my ASM cluster - I know which devices should have which IDs to match the content - but I have no idea how to change it. Any help would be... (2 Replies)
Discussion started by: zxmaus
2 Replies

6. AIX

Difference between Major and Minor in AIX

Difference between Major and Minor in AIX (5 Replies)
Discussion started by: AIXlearner
5 Replies

7. Programming

which head file for major and minor function?

#include <sys/types.h> #include <sys/stat.h> #include <sys/termios.h> #include <stdio.h> #include <stdlib.h> #include <stddef.h> #include <string.h> #include <unistd.h> #include <signal.h> #include <sys/mkdev.h> int main(int argc, char *argv) { int i; struct stat buf; ... (4 Replies)
Discussion started by: konvalo
4 Replies

8. Solaris

Major and Minor number of Virtual File System

Hi friends, Please let me know if there is any way to find out Major and Minor numbers of virtual file system like below: /devices 0K 0K 0K 0% /devices ctfs 0K 0K 0K 0% /system/contract proc 0K 0K ... (8 Replies)
Discussion started by: nitj
8 Replies

9. Shell Programming and Scripting

Filtering my major and minor values

I want to remove all rows with a minor repeating count less than 30% compared to the major repeating count from my table. The values of a col(starting col 2) can assume is A,T,G,C and N. Each row has at least 2 values and at most 4 repeating values(out of ATGC). N is considered a missing value... (12 Replies)
Discussion started by: newbie83
12 Replies
autopush(8)						      System Manager's Manual						       autopush(8)

NAME
autopush - Manages the system's database of automatically pushed STREAMS modules SYNOPSIS
/usr/sbin/autopush -f file /usr/sbin/autopush -r -M major -m minor /usr/sbin/autopush -g -M major -m minor FLAGS
Sets up the system database that contains the lists of modules to be automatically pushed on the streams for STREAMS devices. The file argument specifies the system file from which the command will copy this configuration information. The -f flag is also used to place a device's configuration information back into the database. Gets the configuration information in the system database for the STREAMS major and minor device or devices specified by the -M and -m flags. Removes the configuration information in the system's database for the STREAMS major and minor device or devices specified by the -M and -m flags. DESCRIPTION
The autopush command manages the system's database of information for the automatic configuration of STREAMS devices. The autopush com- mand's flags are mutually exclusive. The command initializes the database with the names of the STREAMS devices to be automatically configured and a list of modules to use for each device (-f flag). When a device is subsequently opened, the STREAMS subsystem pushes the modules on the stream for the device. The autopush command also displays the current configuration information for a device in the database (-g flag), removes the information for a device from the database (-r flag), and replaces the information that has previously been removed (-f flag). When the -f flag is used to replace information in the database, the entire contents of the configuration file are copied. Also, the -r flag removes information only temporarily, because it acts on the database. To permanently exclude a STREAMS device from the database, you must remove its information from the configuration file. A device stream can be automatically constructed for a STREAMS major device, a major device and any associated minor devices, or just the minor devices, depending on the information in the configuration file. Tru64 UNIX provides the autopush.conf file for use as a configura- tion file. You can use another file as long as the information in the file is written in the correct format. The autopush.conf file con- tains one-line entries for each of the STREAMS devices that are to be automatically configured in the system. A line contains at least four fields: Contains an integer representing the STREAMS device's major device. Contains an integer representing one or more minor devices associated with the major device. If minor has a value of -1, then all the minor devices of the driver specified by major are given the same autopush configuration. Contains an integer representing the last minor device in a range associated with the major device. If last_minor has a value of 0 (zero), then the major device has only a single minor device for which the same stream must be constructed. Contains the name of the module to be automatically pushed onto the stream. There can be multiple module name fields, up to a maximum of eight, separated by spaces or commas. The autopush command pushes modules in the order in which they are listed. This means that the first module named is positioned just above the STREAMS device driver. The configuration file can also contain comment lines, which begin with # (number sign) and end with newline. If the major and minor arguments specified by the -M and -m flags of the -r flag option designate a range of minor devices, and minor matches the first minor device number in the range, then the autopush command removes the configuration information for all of the minor devices of the major device. If the major and minor arguments specified by the -M and -m flags of the -g flag option are set for a range in the configuration file, the autopush command returns the configuration information for the first minor device number, in addition to the other information. EXAMPLES
To set up the automatic configuration information for the STREAMS devices in the system, enter: autopush -f /etc/autopush.conf To obtain information about the stream for major device 28 and its minor device -2, enter: autopush -g -M 28 -m -2 FILES
Specifies the modules to be pushed onto the streams for STREAMS devices. RELATED INFORMATION
Interfaces: streamio(7) delim off autopush(8)
All times are GMT -4. The time now is 10:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy