Sponsored Content
Full Discussion: need help awk /etc/exportfs
Top Forums Shell Programming and Scripting need help awk /etc/exportfs Post 302674431 by wittyresponses6 on Thursday 19th of July 2012 06:54:23 PM
Old 07-19-2012
thanks

I was playing around with awk and then sed became apparent.
Thank you it worked perfectly.

---------- Post updated at 02:27 PM ---------- Previous update was at 12:22 PM ----------

still having some issues with the output:

input /filename -sec=sys:krb5p:krb5i:krb5:dh,rw,access=server01:server02:server03,root=server04
output /filename server01 server02 server03,server04

this is what i have so far:
Code:
sed "s/-sec.*access=//;s/-vers.*access=//; s/root=//;s/:/ /g" /etc/exports

---------- Post updated at 03:54 PM ---------- Previous update was at 02:27 PM ----------

Code:
sed "s/-sec.*access=//; s/-vers.*access=//; s/root=//; s/:/ /g" /etc/exports > filename1
sed "s/,/ /g" /filename1

its works for what i need it to do Smilie

Last edited by Franklin52; 07-20-2012 at 04:47 PM.. Reason: Please use code tags for data and code samples, thank you
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

help on rcp,exportfs

i need some help on remote file copyieng.the queeries are: 1:> m working on a machine say(abc) and i want to copy a directory(yes a directory) from a remote machine. so what would be the command. 2:> do in need to login on the source machine from where i want to copy a directory. 3:> is it... (0 Replies)
Discussion started by: mxms755
0 Replies

2. AIX

Exportfs

Hi All I need help here. Some body familiar with the exportfs For AIX5.1, i has exported a /ietelerad/TEST 10.197.6.78 for sharing. At NFS server. $ showmount -e export list for CS72: /ietelerad/TEST 10.197.6.78 $ At NFS Client mount: 1831-011 access denied for... (4 Replies)
Discussion started by: simka
4 Replies

3. HP-UX

Exportfs command not working

Hi All, Here is one peculiar problem I am facing with exportfs command. I have exported these following directories in /etc/dfs/dfstab file /home -access=rx26-156:dhl-6a.digitalindiasw.net /opt -ro /dev -access=rx26-156 /etc/opt -root=rx26-156 then after saving the file when I am... (3 Replies)
Discussion started by: sutapa.hp
3 Replies

4. Shell Programming and Scripting

Awk problem: How to express the single quote(') by using awk print function

Actually I got a list of file end with *.txt I want to use the same command apply to all the *.txt Thus I try to find out the fastest way to write those same command in a script and then want to let them run automatics. For example: I got the file below: file1.txt file2.txt file3.txt... (4 Replies)
Discussion started by: patrick87
4 Replies

5. UNIX for Advanced & Expert Users

exportfs -v and sync option

Dear Friends, I am using Linux system where one nfs share has been configured with rw,sync options. But when I use to check with exportfs -v command it does not show me the sync option I enabled in /etc/exports My doubt is whether I need to use any other command or other options to see... (2 Replies)
Discussion started by: Tlogine
2 Replies

6. AIX

Help on NFS and exportfs

HI guys... Recently I have a request to share an AIX filesystem to a Windows client. Unable to use Samba as this is a production server, and IBM Support does ont support as it is a Third Party application. Not wanting to take the risk, I opt for NFS.. However, reading the pSeries System... (5 Replies)
Discussion started by: mushr00m
5 Replies

7. Shell Programming and Scripting

awk command to compare a file with set of files in a directory using 'awk'

Hi, I have a situation to compare one file, say file1.txt with a set of files in directory.The directory contains more than 100 files. To be more precise, the requirement is to compare the first field of file1.txt with the first field in all the files in the directory.The files in the... (10 Replies)
Discussion started by: anandek
10 Replies

8. Shell Programming and Scripting

HELP with AWK one-liner. Need to employ an If condition inside AWK to check for array variable ?

Hello experts, I'm stuck with this script for three days now. Here's what i need. I need to split a large delimited (,) file into 2 files based on the value present in the last field. Samp: Something.csv bca,adc,asdf,123,12C bca,adc,asdf,123,13C def,adc,asdf,123,12A I need this split... (6 Replies)
Discussion started by: shell_boy23
6 Replies

9. Shell Programming and Scripting

Passing awk variable argument to a script which is being called inside awk

consider the script below sh /opt/hqe/hqapi1-client-5.0.0/bin/hqapi.sh alert list --host=localhost --port=7443 --user=hqadmin --password=hqadmin --secure=true >/tmp/alerts.xml awk -F'' '{for(i=1;i<=NF;i++){ if($i=="Alert id") { if(id!="") if(dt!=""){ cmd="sh someScript.sh... (2 Replies)
Discussion started by: vivek d r
2 Replies

10. Shell Programming and Scripting

awk output yields error: awk:can't open job_name (Autosys)

Good evening, Im newbie at unix specially with awk From an scheduler program called Autosys i want to extract some data reading an inputfile that comprises jobs names, then formating the output to columns for example 1. This is the inputfile: $ more MapaRep.txt ds_extra_nikira_usuarios... (18 Replies)
Discussion started by: alexcol
18 Replies
NetApp::Filer::Export(3pm)				User Contributed Perl Documentation				NetApp::Filer::Export(3pm)

NAME
NetApp::Filer::Export -- OO Class for representing NFS exports SYNOPSIS
use NetApp::Filer; my $filer = NetApp::Filer->new({ ... }); # Filer methods for querying exports: my @exports = $filer->get_exports; my @temporary_exports = $filer->get_temporary_exports; my @permanent_exports = $filer->get_permanent_exports; my @active_exports = $filer->get_active_exports; my @inactive_exports = $filer->get_inactive_exports; # Methods for accessing export attributes foreach my $export ( @exports ) { } # Methods for changing export attributes DESCRIPTION
This class encapsulates a single NFS export on a NetApp filer, and provides methods for managing them. There are related methods in the NetApp::Filer class for manging exports as a whole, but the methods in this class are specific to a single NFS export. API specific attributes This API also attempts to bring some sanity to how exports are managed, and some consistency to the interface. Most of the attributes of an export are fairly obvious, and they map directly to the options supported by "exportfs" and the /etc/exports file. This API introduces two new attributes: 'type' and 'active'; The type attribute In order to distinguish between exports which are temporary (i.e. NOT saved to /etc/exports) and those which are permanent (i.e. ARE saved to /etc/exports), this API support a "type", which be either of: permanent temporary A temporary export is one which was created using "exportfs -io", and which was not saved to /etc/exports. These exports will not survive a reboot of the filer. A permanent export is one which is found in /etc/exports. The active attribute Since you can change the export options for a filesystem temporarily (for example, by using the "fencing" option -b, or just manually specifying different options and re-exporting using -io), some permanent exports may not be in effect on the system. The active attribute is used to track these. If the active attribute is true, then the export is currently in effect. Almost by definition, all temporary exports are always active. However, if a permanent export is not in effect because a temporary export for the same pathname has been created, then such an export is considerd inactive. Global vs. Limited ro/rw Attributes The "ro" and "rw" export options really have two different modes of use. If either option is specified with no "=a[:b[:c...]]" list, then it means ALL hosts. Since this API provides methods for adding and removing entries from those lists, it treats the "all" cases special, by managing thenm as separate attributes. To specify global readonly or readwrite access, use the following options: ro_all rw_all These have boolean values. The "rw" and "ro" attributes/options are ARRAY references, each containing the list of entries for an "rw=" or "ro=" list for managing limited access. Change and Update Semantics There are several methods for changing the attributes of an export object, but in ALL cases, these merely change the object in memory. In order for the attribute change to take effect, the update method must be called, which will generate and execute the appropriate "exportfs" command. For example, suppose you wanted to remove root access for a specific hostname from all exports on a filer: my $untrusted = 'unsafe.foo.com'; my @exports = $filer->get_exports; foreach my $export ( @exports ) { if ( $export->has_root( $untrusted ) ) { $export->remove_root( $untrusted ); $export->update; } } The "remove_root" method simply removes the entry from the object in memory. The "update" method re-exports that filesystem to make the change take effect on the filer. METHODS
get_filer Returns the NetApp::Filer object for the filer on which this export exists. get_type Returns a string with one of the following values: temporary permanent indicating whether or not this particular export has been written to /etc/exports. get_active Returns a boolean value, false only if the type is "permanent", and the same export was not found in the list of currently active exports (i.e. not found in the output of "exportfs"). A temporary export is always active, by definition. get_path Returns a string representing the path for the export. Note that this may not necessarily be the same as the actual pathname of the underlying volume or qtree. get_actual Returns a string representing the "actual" path of the underlying volume or qtree for the export. If a volume or qtree as been exported using a different name, this is the actual path of the underlying object. If this export option was not used, this method will return an empty string. get_nosuid Returns a boolean value, indicating whether or not the "nosuid" option is used by the export. set_nosuid( $boolean ) This method takes a single argument, interpreted in boolean context, an sets the "nosuid" option for the export. get_anon Returns the value of the "anon" option, if set. Since this option can have the value of "0", it returns undef when this option has not been set. WARNING: be careful interpreting this in a simple boolean context. To test whether or not this option has been set use "defined". set_anon( $anon ) Takes a single argument, and sest the "anon" opton to that value. To unset this option, pass an undefined value: $export->set_anon( undef ); get_sec Returns a list of the "sec" option values. set_sec( $arrayref ) Takes a single argument, an array reference of "sec" values, which can be any of: none, sec, krb5, krb5i, or krb5p. This API does no validation of these values, so if an invalid value is given, this will result in a fatal exception when the "update" method is called. has_sec( $sec ) Takes a single string argument, and returns true if that value is found in the list of "sec" options, false otherwise. add_sec( $sec ) Takes a single string argument, and adds that value to the list of "sec" options, if not already present. remove_sec( $sec ) Takes a single string argument, and removes that value from the list of "sec" options, if present. get_root Returns a list of the "root" option values. set_root( $arrayref ) Takes a single argument, an array reference of "root" values, which can be any combination of hostnames, IP addresses, or networks. Again, no data validation is performed, so bogus values will not be detected until the export is updated on the filer, using the "update" method. To clear the root option entirely, simply pass an empty array reference. has_root( $root ) Takes a single string argument, and returns true if that value is found in the list of "root" options, false otherwise. add_root( $root ) Takes a single string argument, and adds that value to the list of "root" options, if not already present. remove_root( $root ) Takes a single string argument, and removes that value from the list of "root" options, if present. get_ro_all Returns a boolean value, indicating whether or not the "ro_all" option has been set. set_ro_all( $boolean ) Takes a single boolean argument, and sets the "ro_all" option to it's value. Setting "ro_all" to a true value will clear the "ro" list, if it exists. Also, if "ro_all" is true, then the following methods will quietly do nothing: has_ro add_ro remove_ro The "ro_all" option must be cleared (set to a false value) first. get_ro Returns a list of the "ro" entries, if any. Returns nothing if "ro_all" has been set. set_ro( $arrayref ) Takes a single argument, an array reference of "ro" values. Setting the "ro" list explicitly will set clear "ro_all" (set it to a false value). has_ro( $ro ) Takes a single argument, and returns true if that value is found in the list of "ro" options, false otherwise. If "ro_all" is true, then it always returns false. add_ro( $ro ) Takes a single string argument, and adds that value to the list of "ro" options, if not already present. If "ro_all" is true, then this method will do nothing. remove_ro( $ro ) Takes a single string argument, and removes that value from the list of "ro" options, if present. If "ro_all" is true, then this method does nothing. get_rw_all, set_rw_all, get_rw, set_rw, has_rw, add_rw, remove_rw All of these methods behave exactly the same as their "ro" counterparts described immediately above. They apply to the "rw" option, instead of "ro", but if that isn't obvious... update This method re-exports the export, using "exportfs". If ANY of the object attributes have been changed programmatically, those changes will not take effect on the filer until this method has been called. Note that updating an export will not necessarily change it's "type" from temporary to permanent, unless the "type" is explicitly changed. compare( $export ) This method takes a single NetApp::Filer::Export object, and compares the current object (that is, the one on which the method was called) to it. If they have the same basic export options, it returns true, otherwise, it returns false. Only the following options are compared: actual nosuid anon sec root rw/rw_all ro/ro_all perl v5.14.2 2008-11-26 NetApp::Filer::Export(3pm)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy