Sponsored Content
Full Discussion: grep within while read loop
Top Forums Shell Programming and Scripting grep within while read loop Post 302364963 by Scott on Saturday 24th of October 2009 05:57:52 PM
Old 10-24-2009
Hi.

Not sure what the wierd combination of double and single quotes around your grep are meant to achieve, but from the data you post, there's nothing in your data file that matches any key in your klist file.

I modified your klist file to add something that did match, and it worked fine (changing your wierd grep to just grep "$addr" mlist)
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

read inside a while loop

Hi all, In a while loop, like below... while read line do read choice case $choice in 1) echo "xxx" esac done < file why I can't run the read choice???? (3 Replies)
Discussion started by: dta4316
3 Replies

2. Shell Programming and Scripting

Need Help : while read loop

hi all, Can you please help me with this issue ? while ####infinite loop do cat file1 |while read var1 var2 do func1 $var1 $var2 done cat file2 | while read var11 var22 do func2 $var11 $var22 done done func1 is called till all the values are read... (2 Replies)
Discussion started by: Navatha
2 Replies

3. Shell Programming and Scripting

read line in a for loop

Hi All, How can we use read line using the index value of a FOR loop? eg: pt_mstr,pt_status,8 pt_mstr,pt_buyer,8 pt_mstr,pt_sfty_stk,8 pt_mstr,pt_ord_pol,3 pt_mstr,pt_capacity,8 pt_mstr,pt_plan_ord,3 pt_mstr,pt_ord_mult,8 From this file i want to read the line2, 3 and 4 only using a FOR... (3 Replies)
Discussion started by: balajim
3 Replies

4. Shell Programming and Scripting

Need help with for loop with while read

Hello, The code below pulls printer information from a three-column file (set by the ${MULTIFILE} variable at the end), that has the printer queue name, IP, and type of printer. It is supposed to use this info to add the printers in the list to one, or more servers . The input file... (3 Replies)
Discussion started by: LinuxRacr
3 Replies

5. Shell Programming and Scripting

While read line loop

Hi I'm writing a bash script which will read an input file and look for occurrences of the current user ($USER) executing the script. When i find the occurrence of the username I take that line and append it to a file with a line number and bracket display next to line. The input file has been... (12 Replies)
Discussion started by: BundBash
12 Replies

6. Shell Programming and Scripting

until loop and read

Hi guys what I wanna do is to create a script where can I input several times a file - assume with read function that will be inserted into a temp. file for further processing. When I press q I want that the loop will stop and continue in my script I typed this but the options q is not working... (6 Replies)
Discussion started by: kl1ngac1k
6 Replies

7. UNIX for Dummies Questions & Answers

Read statement within while read loop

hi, this is my script #!/bin/ksh cat temp_file.dat | while read line do read test if ]; then break else echo "ERROR" fi done when i execute this code , the script does wait for the user input . it directly prints "ERROR" and terminates after the no. of times as there... (3 Replies)
Discussion started by: siva1612
3 Replies

8. Shell Programming and Scripting

Help with while read loop

Hey all, Tried searching the forums but my search-fu may not be strong today; please feel free to redirect me if I have simply missed a post that would be helpful! Trying to create a while loop that reads a list of configuration files, checks for a line that starts with "SOME_CMD" and ends... (4 Replies)
Discussion started by: jdwyer
4 Replies

9. UNIX for Dummies Questions & Answers

Piping grep into awk, read the next line using grep

Hi, I have a number of files containing the information below. """"" Fundallinfo 6.3950 14.9715 14.0482 """"" I would like to grep for Fundallinfo and use it to read the next line? I ideally would like to read the three numbers that follow in the next line and... (2 Replies)
Discussion started by: Paul Moghadam
2 Replies

10. Shell Programming and Scripting

Failure: if grep "$Var" "$line" inside while read line loop

Hi everybody, I am new at Unix/Bourne shell scripting and with my youngest experiences, I will not become very old with it :o My code: #!/bin/sh set -e set -u export IFS= optl="Optl" LOCSTORCLI="/opt/lsi/storcli/storcli" ($LOCSTORCLI /c0 /vall show | grep RAID | cut -d " "... (5 Replies)
Discussion started by: Subsonic66
5 Replies
klist(8krb)															       klist(8krb)

Name
       klist - lists currently held Kerberos tickets

Syntax
       /usr/bin/klist [ -s | -t ] [ -file [filename] ] [ -srvtab ]

Arguments
       filename    The name of the Kerberos ticket file.

Description
       The  command allows you to print the name of the ticket file, the identity of the principal requesting the tickets (as listed in the ticket
       file), and the principal names of all the Kerberos tickets currently held by the user (along with the issue and expiration times  for  each
       authenticator).	Principal names are listed in the form:
       name.instance@realm
       The period (.) is omitted if the instance is null, and the at sign (@) is omitted if the realm is null.

       The  command  also  enables you to print the entries in the file.  If the -srvtab option is selected, will print the service name, instance
       name, realm name, and key version of all services listed in the file.

Options
       -s     Suppresses the printing of the issue and expiration times, the name of the ticket file, or the identity of the principal.

       -t     Checks for the existence of an unexpired ticket-granting-ticket in the ticket file.  If one is present, exits with  status  of  zero(0).  Otherwise, it exits with status 1.	No output is generated when this option is specified.

       -file  Causes the following argument to be used as the ticket file.  Otherwise, the file is used, where is the user ID of the process.

       -srvtab
	      Indicates that data should be printed.  If the -file switch is not used, the data is read from the default file,

Restrictions
       User-level authentication is not supported.  However, by naming the file with the option, you can look at the tickets generated by

Files
       Default		file

       To get the name of the local realm

       The default ticket file

       The file containing tickets generated by

See Also
       kinit(8krb), kdestroy(8krb)

																       klist(8krb)
All times are GMT -4. The time now is 04:43 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy