Sponsored Content
Top Forums Shell Programming and Scripting Cut counting consecutive delimiters as fields Post 302964359 by Aia on Thursday 14th of January 2016 12:03:38 AM
Old 01-14-2016
As a side note, if you want to know the mac assigned to an interface, in a Linux system just read it from /sys:
Code:
cat /sys/class/net/eth0/address

Much faster.
This User Gave Thanks to Aia For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cut based on Two Delimiters at one go

Hi I wanted to cut the feilds comming after % and After $ at one go can we do some thing like this cut -f 2 -d "%|$" (But it doesnot work) Input File BWPG %TCPRP1 $SCSPR000 BWPH %TCPRP1 $SCSPR003 BWPI %TRTYUP ResourceDescription="IMPRIMANTE " $BWOPTY BWPJ %ZOMBIE ... (4 Replies)
Discussion started by: pbsrinivas
4 Replies

2. Shell Programming and Scripting

awk sed cut? to rearrange random number of fields into 3 fields

I'm working on formatting some attendance data to meet a vendors requirements to upload to their system. With some help on the forums here, I have the data close. But they've since changed what they want. The vendor wants me to submit three fields to them. Field 1 is the studentid field,... (4 Replies)
Discussion started by: axo959
4 Replies

3. Shell Programming and Scripting

cut -- line with no delimiters

I just discovered, to my dismay, the following part of the cut man page: -f, --fields=LIST select only these fields; also print any line that contains no delimiter character, unless the -s option is specified The -s option toggles the printing of lines with no delimiters. In most... (3 Replies)
Discussion started by: chlorine
3 Replies

4. Shell Programming and Scripting

Script in SED and AWK so that it treats consecutive delimiters as one

Hi All, I am trying to cut to do a cut operation, but since there are seems to be more than one deltimiters in some occasion I am not able to get the exact field. Can you please provide an SED and AWK script for treating the source file in such a way that all consecutive delimiters are treated... (3 Replies)
Discussion started by: rakesh.su30
3 Replies

5. UNIX for Dummies Questions & Answers

Cut fields between delimiters

I'm having bother getting both lines contained in a file to output as the same value. A simple example: john:123456:123:456:doe john:123456:123:doe cut -d: -f1,4 input file john:456 john:doe ^ first line should be same as second. trick one for me, i know why it's because of the... (4 Replies)
Discussion started by: landofus
4 Replies

6. Shell Programming and Scripting

Counting a consecutive number in column 2

Hi, I have a input file which contains following data 0 1 0 2 0 3 0 4 0 8 0 9 0 11 1 1 1 2 1 6 1 7 1 8 1 9 2 1 2 11 2 12 (12 Replies)
Discussion started by: Ryan Kim
12 Replies

7. 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

8. Shell Programming and Scripting

Getting fields from a file having multiple delimiters

Hi All, I have a file with a single row having the following text ABC.ABC.ABC,Database,New123,DBNAME,F,ABC.ABC.ABC_APP,"@FUNCTION1("ENT1") ,@FUNCTION2("ENT2")",R, I want an output in the following format ABC.ABC.ABC DBNAME ABC.ABC.ABC_APP '@FUNCTION1("ENT1")... (3 Replies)
Discussion started by: dev.devil.1983
3 Replies

9. UNIX for Beginners Questions & Answers

find pattern matches in consecutive lines in certain fields-awk

I have a text file with many thousands of lines, a small sample of which looks like this: InputFile:PS002,003 D -1 5 -1 -1 -1 -1 -1 -1 -1 -1 -1 -1 6 6 -1 -1 -1 -1 0 509 0 PS002,003 PSQ 0 1 7 18 1 0 -1 1 1 3 -1 -1 ... (5 Replies)
Discussion started by: jvoot
5 Replies

10. Shell Programming and Scripting

Cut between two delimiters, / and .

BASH : I have a very long list I am parsing through: 10/10/19... (5 Replies)
Discussion started by: jeffs42885
5 Replies
VFS_HOOKS(9)						   BSD Kernel Developer's Manual					      VFS_HOOKS(9)

NAME
vfs_hooks, vfs_hooks_unmount -- VFS hooks interface SYNOPSIS
#include <sys/param.h> #include <sys/mount.h> void vfs_hooks_unmount(struct mount *mp); DESCRIPTION
The VFS hooks interface provides a way for different kernel subsystems to attach custom functions to specific VFS operations. This enforces code separation by keeping the VFS's core sources uncluttered and makes all subsystem functionality reside in a single place. As an example, this interface is used by the NFS server code to automatically handle the exports list for each mount point. Hooks are described by a struct vfs_hooks object, as seen below: struct vfs_hooks { int (*vh_unmount)(struct mount *); }; For simplicity, each field is named after the VFS operation it refers to. The purpose of each member function, alongside some important notes, is shown below: vh_unmount(mp) This hook is executed during the unmount process of a file system. For more information about the purpose of each operation, see vfsops(9). Note that any of these fields may be a null pointer. After the definition of a struct vfs_hooks object, the kernel has to add it to the vfs_hooks link set using the VFS_HOOKS_ATTACH(struct vfs_hooks *) macro. Please note that this interface is incomplete on purpose to keep it in its smallest possible size (i.e., do not provide a hook that is not used). If you feel the need to hook a routine to a VFS operation that is not yet supported by this interface, just add it to the files described in CODE REFERENCES. FUNCTIONS
The following functions are provided to the VFS code to run the hooked functions: vfs_hooks_unmount(mp) Runs all hooks for the VFS unmount operation. Given that these operations shall not fail, it returns void. CODE REFERENCES
The VFS hooks interface is implemented within the files sys/kern/vfs_hooks.c and sys/sys/mount.h. SEE ALSO
intro(9), vfs(9), vfsops(9) HISTORY
The VFS hooks interface appeared in NetBSD 4.0. BSD
September 23, 2005 BSD
All times are GMT -4. The time now is 02:48 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy