need help awk /etc/exportfs


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting need help awk /etc/exportfs
# 1  
Old 07-19-2012
Data need help awk /etc/exportfs

Need help awk out information from /etc/exports Smilie
Code:
cat /etc/exports
/%filesystem -sec=sys:krb5p:krb5i:krb5:dh,rw,access=server1:server2:server3:server(n+1)

I wanted to edit out (-sec ......,access=) remove the colons and replace is with spaces

output
Code:
/%filesystem server1 server2 server3 server4 server(n+1).....


Last edited by Franklin52; 07-20-2012 at 04:46 PM.. Reason: Please use code tags for data and code samples, thank you
# 2  
Old 07-19-2012
Hi

Code:
sed "s/-sec.*access=//; s/:/ /g" /etc/exports

This User Gave Thanks to Chirel For This Post:
# 3  
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
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
Login or Register to Ask a Question