Sponsored Content
Top Forums UNIX for Beginners Questions & Answers Sed, awk or another bash command to modify string with the content of another file Post 303041977 by rbatte1 on Tuesday 10th of December 2019 07:47:40 AM
Old 12-10-2019
Along with the other questions:-
  • Are you logically looking to just add 4 to the server number, or do you need to work out the highest numbered server and count on from there?
  • Are these decimal server numbers, hexadecimal, looked up from a list or something else perhaps?
  • What happens if you reach server 100, whatever your number format?


Kind regards,
Robin
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Read a file content with awk and sed

Hello , I have huge file with below content. I need to read the numeric values with in the paranthesis after = sign. Please help me with awk and sed script for it. 11.10.2009 04:02:47 Customer login not found: identifier=(0748502889) prefix=(TEL) serviceCode=(). 11.10.2009 04:03:12... (13 Replies)
Discussion started by: rmv
13 Replies

2. Shell Programming and Scripting

awk/sed/perl command to delete specific pattern and content above it...

Hi, Below is my input file: Data: 1 Length: 20 Got result. Data: 2 Length: 30 No result. Data: 3 Length: 20 (7 Replies)
Discussion started by: edge_diners
7 Replies

3. Shell Programming and Scripting

Script to open a saved file and modify the content

I am looking for a script where I need to open a file and modify the data like changing the parameters.Can anyone help me? open a file software.rsp . It already contains following data. parameter = false threads=100 user= demf The above should be changed to paramter=true thread= 133... (3 Replies)
Discussion started by: sriki32
3 Replies

4. Shell Programming and Scripting

How can i delete the content between all the occurences of two strings using sed or awk command

Hi. I have to delete the content between all the occurrences of the xml tags in a single file. For example: * The tags <script>.....................</script> occurs more than once in the same file. * It follows tagging rules meaning a start tag will be followed by an end tag. Will not have... (9 Replies)
Discussion started by: satheeshkumar
9 Replies

5. Shell Programming and Scripting

Modify the file with awk,sed or perl

Hi All, I need help from any of you.Would be so thankful for your help. I/P DDDD,1045,161,1557,429,1694,800,1911,1113,2460,1457,2917> 1609,3113,1869,3317,2732,3701,3727,4132,5857,5107> 9004,6496 DDDD,1125,157,1558,429,1694,800,1911,1117,2432,1444,2906>... (2 Replies)
Discussion started by: Indra2011
2 Replies

6. Shell Programming and Scripting

sed or awk command to replace a string pattern with another string based on position of this string

here is what i want to achieve... consider a file contains below contents. the file size is large about 60mb cat dump.sql INSERT INTO `table1` (`id`, `action`, `date`, `descrip`, `lastModified`) VALUES (1,'Change','2011-05-05 00:00:00','Account Updated','2012-02-10... (10 Replies)
Discussion started by: vivek d r
10 Replies

7. Shell Programming and Scripting

Replace string in XML file with awk/sed with string from another

Sorry for the long/weird title but I'm stuck on a problem I have. I have this XML file: </member> <member> <name>TransactionID</name> <value><string>123456789123456</string></value> </member> <member> <name>Number</name> ... (9 Replies)
Discussion started by: cozzin
9 Replies

8. Shell Programming and Scripting

awk modify string

Hi Guys, i world like to do the following with awk, i have the the complete username example in a file a have some names Mario Rossi John Doe i would like to convert this name in this format from file with awk Mario,Rossi,"Mario Rossi ",m.rossi_ext@mydomain.com,$TRUE, John,Doe,"John... (7 Replies)
Discussion started by: charli1
7 Replies

9. Shell Programming and Scripting

Replace string of a file with a string of another file for matches using grep,sed,awk

I have a file comp.pkglist which mention package version and release . In 'version change' and 'release change' line there are two versions 'old' and 'new' Version Change: --> Release Change: --> cat comp.pkglist Package list: nss-util-devel-3.28.4-1.el6_9.x86_64 Version Change: 3.28.4 -->... (1 Reply)
Discussion started by: Paras Pandey
1 Replies

10. UNIX for Beginners Questions & Answers

Awk/sed command to extract the string between 2 patterns but having some particular value

Hi - i have one file with content as below. ***** BEGIN 123 ***** BASH is awesome ***** END ***** ***** BEGIN 365 ***** KSH is awesome ***** END ***** ***** BEGIN 157 ***** KSH is awesome ***** END ***** ***** BEGIN 7123 ***** C is awesome ***** END ***** I am trying to find all... (4 Replies)
Discussion started by: reldb
4 Replies
kclient(1M)						  System Administration Commands					       kclient(1M)

NAME
kclient - set up a machine as a Kerberos client SYNOPSIS
/usr/sbin/kclient [-n] [-R realm] [-k kdc] [-a adminuser] [-c filepath] [-d dnsarg] [-f fqdn_list] [-p profile] DESCRIPTION
You can use the kclient utility to: o Configure a machine as a Kerberos client for a specified realm and for KDC by setting up krb5.conf(4). o Add the Kerberos host principal to the local host's keytab file (/etc/krb5/krb5.keytab). o Optionally set up the machine to do kerberized NFS. o Optionally bring over a master krb5.conf copy from a specified pathname. o Optionally setup a machine to do server and/or host/domain name-to-realm mapping lookups by means of DNS. The kclient utility needs to be run on the client machine with root permission and can be run either interactively or non-interactively. In the non-interactive mode, the user feeds in the required inputs by means of a profile, command-line options, or a combination of profile and command-line options. The user is prompted for "required" parameter values (realm, kdc, and adminuser), if found missing in the non- interactive run. The interactive mode is invoked when the utility is run without any command-line arguments. Both the interactive and non-interactive forms of kclient always add the host/fqdn entry to the local host's keytab file. They also require the user to enter the password for the administrative user requested, to obtain the Kerberos Ticket Granting Ticket (TGT) for adminuser. The host/fqdn, nfs/fqdn, and root/fqdn principals are added to the KDC database (if not already present) before their addition to the local host's keytab. The kclient utility assumes that the local host has been setup for DNS and requires the presence of a valid resolv.conf(4). Also, kclient can fail if the localhost time is not synchronized with that of the KDC. For Kerberos to function the localhost time must be within five minutes of that of the KDC. It is advised that both systems run some form of time synchronization protocol, such as the Network Time Proto- col (NTP). See xntpd(1M). OPTIONS
The non-interactive mode supports the following options: -n Set up the machine for kerberized NFS. This involves making changes to nfssec.conf(4) and addition of the nfs/fqdn and root/fqdn entries to the local host's keytab file. -R [ realm] Specifies the Kerberos realm. -k [ kdc] Specifies the machine to be used as the Kerberos Key Distribution Center (KDC). -a [ adminuser ] Specifies the Kerberos administrative user. -c [ filepath ] Specifies the pathname to the krb5.conf(4) master file, to be copied over to the local host. The path specified normally points to a master copy on a remote host and brought over to the local host by means of NFS. -d [ dnsarg] Specifies the DNS lookup option to be used and specified in the krb5.conf(4) file. Valid dnsarg entries are: none, dns_lookup_kdc, dns_lookup_realm and dns_fallback. Any other entry is considered invalid. The latter three dnsarg values assume the same meaning as those described in krb5.conf. dns_lookup_kdc implies DNS lookups for the KDC and the other servers. dns_lookup_realm is for host/domain name-to-realm mapping by means of DNS. dns_fallback is a superset and does DNS lookups for both the servers and the host/domain name- to-realm mapping. A lookup option of none specifies that DNS is not be used for any kind of mapping lookup. -f [ fqdn_list] This option creates a service principal entry (host/nfs/root) associated with each of the listed fqdn's, if required, and subsequently adds the entries to the local host's keytab. fqdn_list is a comma-separated list of one or more fully qualified DNS domain names. This option is especially useful in Kerberos realms having systems offering kerberized services, but situated in multiple different DNS domains. -p [ profile] Specifies the profile to be used to enable the reading in of the values of all the parameters required for setup of the machine as a Kerberos client. The profile should have entries in the format: PARAM <value> Valid PARAM entries are: REALM, KDC, ADMIN, FILEPATH, NFS, DNSLOOKUP, and FQDN. These profile entries correspond to the -R [realm], -k [kdc], -a [adminuser], -c [filepath], -n, -d [dnsarg], and -f [fqdn_list] command-line options, respectively. Any other PARAM entry is considered invalid and is ignored. The NFS profile entry can have a value of 0 (do nothing) or 1 (operation is requested). Any other value is considered invalid and is ignored. Keep in mind that the command line options override the PARAM values listed in the profile. EXAMPLES
Example 1: Setting Up a Kerberos Client Using Command-Line Options To setup a Kerberos client using the clntconfig/admin administrative principal for realm 'ABC.COM', kdc `example1.com' and that also does kerberized NFS, enter: # /usr/sbin/kclient -n -R ABC.COM -k example1.com -a clntconfig Alternatively, to set up a Kerberos client using the clntconfig/admin administrative principal for the realm `EAST.ABC.COM', kdc `exam- ple2.east.abc.com' and that also needs service principal(s) created and/or added to the local keytab for multiple DNS domains, enter: # /usr/sbin/kclient -n -R EAST.ABC.COM -k example2.east.abc.com -f west.abc.com,central.abc.com -a clntconfig Note that the krb5 administrative principal used by the administrator needs to have only add, inquire, change-pwd and modify privileges (for the principals in the KDC database) in order for the kclient utility to run. A sample kadm5.acl(4) entry is: clntconfig/admin@ABC.COM acmi Example 2: Setting Up a Kerberos Client Using the Profile Option To setup a Kerberos client using the clntconfig/admin administrative principal for realm `ABC.COM', kdc `example1.com' and that also copies over the master krb5.conf from a specified location, enter: # /usr/sbin/kclient -p /net/example1.com/export/profile.krb5 The contents of profile.krb5: REALM ABC.COM KDC example1 ADMIN clntconfig FILEPATH /net/example1.com/export/krb5.conf NFS 0 DNSLOOKUP none FILES
/etc/krb5/kadm5.acl Kerberos access control list (ACL) file. /etc/krb5/krb5.conf Default location for the local host's configuration file. /etc/krb5/krb5.keytab Default location for the local host's keytab file. /etc/nfssec.conf File listing NFS security modes. /etc/resolv.conf DNS resolver configuration file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWkdcu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
xntpd(1M), kadm5.acl(4), krb5.conf(4), nfssec.conf(4), resolv.conf(4), attributes(5) NOTES
fqdn stands for the Fully Qualified Domain Name of the local host. The kclient utility saves copies of both the krb5.conf(4) and nfssec.conf(4) files to files with corresponding names and .sav extensions. The optional copy of the krb5.conf(4) master file is neither encrypted nor integrity-protected and it takes place over regular NFS. SunOS 5.10 20 Aug 2004 kclient(1M)
All times are GMT -4. The time now is 03:44 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy