Sponsored Content
Top Forums Shell Programming and Scripting Script to display record spanning over multiple lines Post 302294311 by Ujan on Thursday 5th of March 2009 02:27:36 AM
Old 03-05-2009
Script to display record spanning over multiple lines

Following are the lines from /etc/sudoers.conf
bob SPARC = (OP) ALL : SGI = (OP) ALL
fred ALL = (DB) NOPASSWD: ALL
ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\
/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM


Could you please help me with shell/perl script to display the records
with NOPASSWD ...Not just display of lines with "NOPASSWD"..like for
ALL I need to display ==>
ALL CDROM = NOPASSWD: /sbin/umount /CDROM,\
/sbin/mount -o nosuid\,nodev /dev/cd0a /CDROM

Thanks for your help
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Display multiple output lines

All, I have a file ABC.TXT which has two records: 12345 19.93 34.94 12345 94.84 10.48 If do the following command and grep '12345' ABC.TXT >> test1.txt If I look at the output of test1.txt I appears as follows: 12345 19.93 34.94 12345 94.84 10.48 I... (5 Replies)
Discussion started by: kingofprussia
5 Replies

2. Shell Programming and Scripting

using sed command to delete a string spanning multiple lines

file1 contains the following data sssssssssss firstline secondline pppppppppp ssssssssss Using sed comamnd i am trying to delete firtsline secondline. so, output should be sssssssssss pppppppppp ssssssssss I tried in the following the way, but it is not working. sed ... (9 Replies)
Discussion started by: radha.kalivar
9 Replies

3. UNIX for Dummies Questions & Answers

backup spanning multiple DVDs

Fedora Core 6 2.6.20-1.2962.fc6 I have about 15 GB of data that I need to backup to Single-Layer DVDs. Is there a backup method that will allow me to backup spanning multiple DVDs? (0 Replies)
Discussion started by: dangral
0 Replies

4. Programming

Compiling kernel mnodule spanning multiple files

Hello i guys i have a kernel module which has a list.c library I have one file mod.c (the main kernel module) and one list.c (which is the library) Could you please help me with the following questions .. 1) Is a header file needed (list.h) to be included in the mod.c ? 2) do we need to... (0 Replies)
Discussion started by: natraj
0 Replies

5. Shell Programming and Scripting

Cut display multiple lines of output

I have a script that runs a command, and the output is on multiple lines. The fields are delimited by '='. I need the 8th column from the first line and the 2nd from the second line, but I can't figure out how to display the second line. command1 | cut -d '=' -f 8 The above gets me what I... (2 Replies)
Discussion started by: cbo0485
2 Replies

6. Shell Programming and Scripting

AWK record in multiple lines

Hi everyboby this is my problem I Have this input 1111;222 222 2;333 3333;4444 111; 22222;33 33; 444 and I need this output 1111;2222222;3333333;4444 (15 Replies)
Discussion started by: agritur
15 Replies

7. Shell Programming and Scripting

Replacing pattern spanning multiple lines

Hi. I have input like this: <tr> <td class="logo1" rowspan="2"><a href="index.html"><img src="images/logo.png" /></a></td> <td class="pad1" rowspan="2">__</td> <td class="userBox"><img src="images/person.png"/> <a href="http://good.mybook.com/login.jsp">Sign In</a></td> <td... (5 Replies)
Discussion started by: zorrox
5 Replies

8. Shell Programming and Scripting

Retrieve the record using 2,2 lines and display the ouput in columnwise

This is my file ------------- Using index 8 for dump of table abd_det. (6101) Dumped 0 records. (13932) Using index 10 for dump of table abscc_det. (6101) Dumped 0 records. (13932) Using index 14 for dump of table absc_det. (6101) Dumped 254365 records. (13932) Using index 16 for dump of... (10 Replies)
Discussion started by: chakkaravarthy
10 Replies

9. UNIX for Dummies Questions & Answers

Display latest record from file based on multiple columns combination

I have requirement to print latest record from file based on multiple columns combination. EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/16/2015 100004 03/16/2015 100005 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 140003 03/18/2015 140004 001 EWAPE EW1SLE0000 EW1SOMU01 ABORTED 03/18/2015 220006... (1 Reply)
Discussion started by: tmalik79
1 Replies

10. Shell Programming and Scripting

Grep and display multiple lines

Hi guys, I have a log file that generates multiple logs about a query. <query time='2016-04-13 13:01:50.825'> <PagingRequestHandler> <Before>brand:vmu</Before> <After>brand:vmu</After> </PagingRequestHandler> <GroupDeviceFilterHandler> <Before>brand:vmu</Before> ... (3 Replies)
Discussion started by: Junaid Subhani
3 Replies
MOUNT(8)						      System Manager's Manual							  MOUNT(8)

NAME
mount - mount file systems SYNOPSIS
mount [ -adfruvw ] [ -t ufs | external_type ] mount [ -dfruvw ] special | node mount [ -dfruvw ] [ -o options ] [ -t ufs | external_type ] special node DESCRIPTION
The mount command calls the mount(2) system call to prepare and graft a special device on to the file system tree at the point node. If either special or node are not provided, the appropriate information is taken from the fstab(5) file. The system maintains a list of currently mounted file systems. If no arguments are given to mount, this list is printed. The options are as follows: -a Causes everything to be done except for the actual system call. This option is useful in conjunction with the -v flag to determine what the mount command is trying to do. -f Forces the revocation of write access when trying to downgrade a filesystem mount status from read-write to read-only. For 2.11BSD this flag is currently not implemented. -o Options are specified with a -o flag followed by a comma separated string of options. The following options are available: async All I/O to the file system should be done asynchronously. This is a dangerous flag to set, and should not be used unless you are prepared to recreate the file system should your system crash. force The same as -f; forces the revocation of write access when trying to downgrade a filesystem mount status from read- write to read-only. This is not (and likely never will be) supported in 2.11BSD. nodev Do not interpret character or block special devices on the file system. This option is useful for a server that has file systems containing special devices for architectures other than its own. noexec Do not allow execution of any binaries on the mounted file system. This option is useful for a server that has file systems containing binaries for architectures other than its own. nosuid Do not allow set-user-identifier or set-group-identifier bits to take effect. rdonly The same as -r; mount the file system read-only (even the super-user may not write it). sync All I/O to the file system should be done synchronously. update The same as -u; indicate that the status of an already mounted file system should be changed. Any additional options specific to a filesystem type that is not one of the internally known types (see the -t option) may be passed as a comma separated list; these options are distinguished by a leading - (dash). Options that take a value are specified using the syntax -option=value. At present no 2.11BSD mount options use the following form, the example has been retained for illustrative purposes only. For example, the mount command: mount -t mfs -o nosuid,-N,-s=4000 /dev/dk0b /tmp causes mount to execute the equivalent of: /sbin/mount_mfs -o nosuid -N -s 4000 /dev/dk0b /tmp -r The file system is to be mounted read-only. Mount the file system read-only (even the super-user may not write it). The same as the ``rdonly'' argument to the -o option. -t "ufs | external type" The argument following the -t is used to indicate the file system type. The type ufs is the default. Ufs is also the only value supported by 2.11BSD other than swap. Thus the -t will rarely be used. The -t option can be used to indicate that the actions should only be taken on filesystems of the specified type. More than one type may be specified in a comma separated list. The list of filesystem types can be prefixed with ``no'' to specify the filesystem types for which action should not be taken. For example, the mount command: mount -a -t nonfs,mfs mounts all filesystems except those of type NFS and MFS. If the type is not one of the internally known types, mount will attempt to execute a program in /sbin/mount_XXX where XXX is replaced by the type name. For example, mfs filesystems are mounted by the program /sbin/mount_mfs. -u The -u flag indicates that the status of an already mounted file system should be changed. Any of the options discussed above (the -o option) may be changed; also a file system can be changed from read-only to read-write or vice versa. An attempt to change from read-write to read-only will fail if any files on the filesystem are currently open for writing unless the -f flag is also specified. This is currently not implemented in 2.11BSD. The ability to change the flags (nodev, nosuid, etc) is however supported. The set of options is determined by first extracting the options for the file system from the fstab table, then applying any options specified by the -o argument, and finally applying the -r or -w option. -v Verbose mode. -w The file system object is to be read and write. FILES
/etc/fstab file system table SEE ALSO
mount(2), fstab(5), umount(8) BUGS
It is possible for a corrupted file system to cause a crash. mount and this manpage were ported from 4.4BSD-Lite to 2.11BSD to gain the ability to set the various flags such as nodev, nosuid and so on. Multiple filesystem types are not supported and several of the options and flags are not implemented. HISTORY
A mount command appeared in Version 6 AT&T UNIX. 4.4 Berkeley Distribution November 16, 1996 MOUNT(8)
All times are GMT -4. The time now is 11:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy