Sponsored Content
Top Forums UNIX for Advanced & Expert Users use of variables in awk to search for pattern from a file Post 302576191 by jeanjkj on Thursday 24th of November 2011 02:26:45 AM
Old 11-24-2011
Thanks mate, i never knew an apostrophe would change my life altogether Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

awk pattern search and put in a file

hi I am doing a task that is i have to search for multiple pattern from a file's 9 th column and then redirect it to a new file awk -F, 'BEGIN {OSF=","} { if ($9 == "OTF") print $0}' test1.tsv > test.tsv and the patterns are OST. ODI,MIN LIKE OTF Bit not getting the desired output... (11 Replies)
Discussion started by: pranabrana
11 Replies

2. Shell Programming and Scripting

Awk search for string pattern in delimited file

I've got a semicolon delimited file. I would like to search for fields that match a pattern, and not hardcoded eg "mth". *th=something If the delimited field fulfills this condition, eg. mth=value I would like to print out both key and value for some number comparison. eg. if value > "12"... (5 Replies)
Discussion started by: alienated
5 Replies

3. Shell Programming and Scripting

Awk/Sed: Search Pattern from file and Print

Hi, I want to search for patterns (from a file) in a file and print the line matching the patterns and the line before it. I have to search for 100s of patterns from a file. Any help with AWK or Sed. Thanks! (2 Replies)
Discussion started by: saint2006
2 Replies

4. Shell Programming and Scripting

Text pattern with AWK and variables

How to to pass variable to the below awk command I would like to pass variables to the awk command instead of the constants "a/cc" but I don't know exactly the correct syntax awk '/a/,/cc/' temp1.out file.txt a b s cc g d output a b s (8 Replies)
Discussion started by: ahmedamro
8 Replies

5. Shell Programming and Scripting

Help to search multiple pattern in file with grep/sed/awk

Hello All, I have a file which is having below type of data, Jul 19 2011 | 123456 Jul 19 2011 | 123456 Jul 20 2011 | 123456 Jul 20 2011 | 123456 Here I wanted to grep for date pattern as below, so that it should only grep "Jul 20" OR "Jul ... (9 Replies)
Discussion started by: gr8_usk
9 Replies

6. Shell Programming and Scripting

awk get search pattern from a file.

Here Is a problem I am facing with awk. Query --> I want to search for a string in a file and print next 15 lines below the matched string. 1.We do not have GNU grep so cannot use grep -A or grep -B commands. 2. Instead of passing the search pattern as a string to awk. I want the awk to... (4 Replies)
Discussion started by: togotutor
4 Replies

7. Shell Programming and Scripting

Awk to match a pattern and perform a search after the first pattern

Hello Guyz I have been following this forum for a while and the solutions provided are super useful. I currently have a scenario where i need to search for a pattern and start searching by keeping the first pattern as a baseline ABC DEF LMN EFG HIJ LMN OPQ In the above text i need to... (8 Replies)
Discussion started by: RickCharles
8 Replies

8. Shell Programming and Scripting

awk search/replace specific field, using variables for regexp & subsitution then overwrite file

Hello, I'm trying the solve the following problem. I have a file which I intend to use as a csv called master.csv The columns are separated by commas. I want to change the text on a specific row in either column 3,4,5 or 6 from xxx to yyy depending upon if column 1 matches a specified pattern.... (3 Replies)
Discussion started by: cyphex
3 Replies

9. Shell Programming and Scripting

Search for a pattern in a String file and count the occurance of each pattern

I am trying to search a file for a patterns ERR- in a file and return a count for each of the error reported Input file is a free flowing file without any format example of output ERR-00001=5 .... ERR-01010=10 ..... ERR-99999=10 (4 Replies)
Discussion started by: swayam123
4 Replies

10. UNIX for Beginners Questions & Answers

Grep/awk using a begin search pattern and end search pattern

I have this fileA TEST FILE ABC this file contains ABC; TEST FILE DGHT this file contains DGHT; TEST FILE 123 this file contains ABC, this file contains DEF, this file contains XYZ, this file contains KLM ; I want to have a fileZ that has only (begin search pattern for will be... (2 Replies)
Discussion started by: vbabz
2 Replies
KADMIN(8)						    BSD System Manager's Manual 						 KADMIN(8)

NAME
kadmin -- Kerberos administration utility SYNOPSIS
kadmin [-p string | --principal=string] [-K string | --keytab=string] [-c file | --config-file=file] [-k file | --key-file=file] [-r realm | --realm=realm] [-a host | --admin-server=host] [-s port number | --server-port=port number] [-l | --local] [-h | --help] [-v | --version] [command] DESCRIPTION
The kadmin program is used to make modifications to the Kerberos database, either remotely via the kadmind(8) daemon, or locally (with the -l option). Supported options: -p string, --principal=string principal to authenticate as -K string, --keytab=string keytab for authentication principal -c file, --config-file=file location of config file -k file, --key-file=file location of master key file -r realm, --realm=realm realm to use -a host, --admin-server=host server to contact -s port number, --server-port=port number port to use -l, --local local admin mode If no command is given on the command line, kadmin will prompt for commands to process. Some of the commands that take one or more principals as argument (delete, ext_keytab, get, modify, and passwd) will accept a glob style wildcard, and perform the operation on all matching prin- cipals. Commands include: add [-r | --random-key] [--random-password] [-p string | --password=string] [--key=string] [--max-ticket-life=lifetime] [--max-renewable-life=lifetime] [--attributes=attributes] [--expiration-time=time] [--pw-expiration-time=time] principal... Adds a new principal to the database. The options not passed on the command line will be promped for. add_enctype [-r | --random-key] principal enctypes... Adds a new encryption type to the principal, only random key are supported. delete principal... Removes a principal. del_enctype principal enctypes... Removes some enctypes from a principal; this can be useful if the service belonging to the principal is known to not handle certain enctypes. ext_keytab [-k string | --keytab=string] principal... Creates a keytab with the keys of the specified principals. get [-l | --long] [-s | --short] [-t | --terse] [-o string | --column-info=string] principal... Lists the matching principals, short prints the result as a table, while long format produces a more verbose output. Which columns to print can be selected with the -o option. The argument is a comma separated list of column names optionally appended with an equal sign ('=') and a column header. Which columns are printed by default differ slightly between short and long output. The default terse output format is similar to -s -o principal=, just printing the names of matched principals. Possible column names include: principal, princ_expire_time, pw_expiration, last_pwd_change, max_life, max_rlife, mod_time, mod_name, attributes, kvno, mkvno, last_success, last_failed, fail_auth_count, policy, and keytypes. modify [-a attributes | --attributes=attributes] [--max-ticket-life=lifetime] [--max-renewable-life=lifetime] [--expiration-time=time] [--pw-expiration-time=time] [--kvno=number] principal... Modifies certain attributes of a principal. If run without command line options, you will be prompted. With command line options, it will only change the ones specified. Possible attributes are: new-princ, support-desmd5, pwchange-service, disallow-svr, requires-pw-change, requires-hw-auth, requires-pre-auth, disallow-all-tix, disallow-dup-skey, disallow-proxiable, disallow-renewable, disallow-tgt-based, disallow-forwardable, disallow-postdated Attributes may be negated with a "-", e.g., kadmin -l modify -a -disallow-proxiable user passwd [-r | --random-key] [--random-password] [-p string | --password=string] [--key=string] principal... Changes the password of an existing principal. password-quality principal password Run the password quality check function locally. You can run this on the host that is configured to run the kadmind process to verify that your configuration file is correct. The verification is done locally, if kadmin is run in remote mode, no rpc call is done to the server. privileges Lists the operations you are allowed to perform. These include add, add_enctype, change-password, delete, del_enctype, get, list, and modify. rename from to Renames a principal. This is normally transparent, but since keys are salted with the principal name, they will have a non-standard salt, and clients which are unable to cope with this will fail. Kerberos 4 suffers from this. check [realm] Check database for strange configurations on important principals. If no realm is given, the default realm is used. When running in local mode, the following commands can also be used: dump [-d | --decrypt] [dump-file] Writes the database in ``human readable'' form to the specified file, or standard out. If the database is encrypted, the dump will also have encrypted keys, unless --decrypt is used. init [--realm-max-ticket-life=string] [--realm-max-renewable-life=string] realm Initializes the Kerberos database with entries for a new realm. It's possible to have more than one realm served by one server. load file Reads a previously dumped database, and re-creates that database from scratch. merge file Similar to load but just modifies the database with the entries in the dump file. stash [-e enctype | --enctype=enctype] [-k keyfile | --key-file=keyfile] [--convert-file] [--master-key-fd=fd] Writes the Kerberos master key to a file used by the KDC. SEE ALSO
kadmind(8), kdc(8) BSD
Feb 22, 2007 BSD
All times are GMT -4. The time now is 12:14 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy