Sponsored Content
Top Forums Shell Programming and Scripting Find Unmatched name from given lists.. Post 302749497 by Killer420 on Friday 28th of December 2012 12:44:03 PM
Old 12-28-2012
spcl thnx to bipinajith....
exact ans. which i want..
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

else unmatched

I'm getting an else unmatched error on the script below.. For info : SYDB is the database name entered as a param on the command line. #Check the DB name HBDB=`sql $SYDB <<_END_ | grep '^|' | grep -v dbase | sed 's/|//g' | sed 's/ //g' set autocommit on; \p\g set lockmode... (7 Replies)
Discussion started by: b.hamilton
7 Replies

2. Shell Programming and Scripting

list of unmatched columns

Hi , I have two files want to compare and list of column values and postion which are not matched between two files,I can use diff but it will return rows from two files which are matched and unmatched columns.I wrote the below script but not working. f1=$1 f2=$2 for i in 1 do file1=`cat... (3 Replies)
Discussion started by: mohan705
3 Replies

3. Shell Programming and Scripting

done' unexpected and do' unmatched

Good morning, I have been teaching myself shell scripting and seem to be stuck here. I am sure I am just blind and not seeing it so I thought maybe some fresh eyes would help. With the script below I keep getting.... "syntax error at line 248 : `done' unexpected" I am not seeing why this... (6 Replies)
Discussion started by: LRoberts
6 Replies

4. Shell Programming and Scripting

`for' unmatched

:b:Hi guys, I am getting this error in this piece of code, Any help will be appreciate rypidoc.shl: syntax error at line 79 : `for' unmatched ##Determine if there is a file to process ls 3526*.dat > /dev/null 2>&1 if then exit fi for i in 3526*.dat do # Capture just the file... (2 Replies)
Discussion started by: rechever
2 Replies

5. Shell Programming and Scripting

remove unmatched values

Below is my requirement : unmatched values should get deleted from file1 file1 A-1 B-1 C-1 D-2 E-3 F-4 file2 D C F output C-1 D-2 F-4 (2 Replies)
Discussion started by: lavnayas
2 Replies

6. Shell Programming and Scripting

Shell Script to Create non-duplicate lists from two lists

File_A contains Strings: a b c d File_B contains Strings: a c z Need to have script written in either sh or ksh. Derive resultant files (File_New_A and File_New_B) from lists File_A and File_B where string elements in File_New_A and File_New_B are listed below. Resultant... (7 Replies)
Discussion started by: mlv_99
7 Replies

7. Shell Programming and Scripting

Find the difference between two server lists

I just want to find the server names that belong to one list but doesnt belong to another. Just the server names in output. (3 Replies)
Discussion started by: proactiveaditya
3 Replies

8. Shell Programming and Scripting

Unmatched <<

Hi, I am running sinple ksh script . From some reason it failed on the following error: ./ogg_status.sh: syntax error at line 16 : `<<' unmatched Please advise. #!/usr/bin/ksh export ORACLE_HOME=/software/oracle/DB10gR2 export LD_LIBRARY_PATH=/software/oracle/DB10gR2/lib:/usr/lib... (4 Replies)
Discussion started by: yoavbe
4 Replies

9. Shell Programming and Scripting

If statement with unmatched condition

Hi Gurus, I'm facing some issues with multiple conditions in my if statement. if (!($InputLine=~/^Date/)) && (!($fields eq "VEN")) { Above is the line troughing some syntax errors. I am trying to avoid the below creteria lines to process in my logic. Records starting with... (4 Replies)
Discussion started by: hi.villinda
4 Replies

10. Shell Programming and Scripting

<< unmatched error

Hi all, I want to call a plsql package that does not return any value. I am using the following script to do so: sqlplus $UserNamePwd <<EOF set head off begin test_pkg.procedure('$DebugFlag'); end; exit EOF if then log_message "procedure failed." exit 1 fi exit $? I... (2 Replies)
Discussion started by: reshma15193
2 Replies
PAM::FAQ(3pm)						User Contributed Perl Documentation					     PAM::FAQ(3pm)

NAME
Authen::PAM::FAQ - Frequently-Asked Questions about Authen::PAM. SYNOPSIS
perldoc Authen::PAM::FAQ VERSION
This document is currently at version 0.05, as of May 4, 2005 DESCRIPTION
1. Can I authenticate a user non interactively? Yes, you can although not in a very clean way. The PAM library has a mechanism, in a form of a conversation function, to send and receive text data from the user. For details of the format of the conversation function consult the Authen::PAM manual. This function receives a list of code/string pairs. There are two codes (PAM_TEXT_INFO and PAM_ERROR_MSG) for displaying the associated string to the user and two codes (PAM_ECHO_ON and PAM_ECHO_OFF) for getting input from the user. As you can see the codes are rather general and you can not be completely sure when you are asked for a user name and when for a password. However, the common practice is that PAM_ECHO_ON is used for a user name and PAM_ECHO_OFF is used for a password. So, what you can do is to write your own conversation function which ignores the PAM_TEXT_INFO and PAM_ERROR_MSG codes and returns the user name for the code PAM_ECHO_ON and the password for the code PAM_ECHO_OFF. If you pass the user name in the initialization function then usually you will not be asked for it. Here is a simple example how to do this: use Authen::PAM; use POSIX qw(ttyname); $service = "login"; $username = "foo"; $password = "bar"; $tty_name = ttyname(fileno(STDIN)); sub my_conv_func { my @res; while ( @_ ) { my $code = shift; my $msg = shift; my $ans = ""; $ans = $username if ($code == PAM_PROMPT_ECHO_ON() ); $ans = $password if ($code == PAM_PROMPT_ECHO_OFF() ); push @res, (PAM_SUCCESS(),$ans); } push @res, PAM_SUCCESS(); return @res; } ref($pamh = new Authen::PAM($service, $username, &my_conv_func)) || die "Error code $pamh during PAM init!"; $res = $pamh->pam_set_item(PAM_TTY(), $tty_name); $res = $pamh->pam_authenticate; print $pamh->pam_strerror($res)," " unless $res == PAM_SUCCESS(); The Authen::PAM module comes with a default conversation function which you can find in the file PAM.pm. 2. Can I change a password non interactively? All the discussion of the previous question also applies here. There is however one serious complication. When changing a password it is quite possible that the PAM library will send you at lest two PAM_ECHO_OFF prompts - one for the old password and one or two for the new one. Therefore, the first thing you should do is to see what sequence of prompts is produced by your service. Then the conversation function should include some state variable to distinguish the different prompts. Here is an example: use Authen::PAM; $service = "passwd"; $username = "foo"; $oldpassword = "old_pass"; $newpassword = "new_pass"; sub my_conv_func { my @res; while ( @_ ) { my $code = shift; my $msg = shift; my $ans = ""; $ans = $username if ($code == PAM_PROMPT_ECHO_ON() ); if ($code == PAM_PROMPT_ECHO_OFF() ) { $ans = $oldpassword if ($state == 0); $ans = $newpassword if ($state == 1); $ans = $newpassword if ($state == 2); $state++; } push @res, (PAM_SUCCESS(),$ans); } push @res, PAM_SUCCESS(); return @res; } ref($pamh = new Authen::PAM($service, $username, &my_conv_func)) || die "Error code $pamh during PAM init!"; $state = 0; $res = $pamh->pam_chauthtok; print $pamh->pam_strerror($res)," " unless $res == PAM_SUCCESS(); If you are running the script as root then most likely you will not be prompted for an old password. In this case you can simply return the new password at the ECHO_OFF prompt. The $msg variable contains the text of the input prompt which you can use for additional test or for debugging purposes, e.g. if ($code == PAM_PROMPT_ECHO_OFF() ) { if ($state>=1 || $msg=~/new/i) { # are we asked for a new password $ans = $newpassword; } else { $ans = $oldpassword; } $state++; } 3. Why are the constants PAM_AUTHTOK and PAM_OLDAUTHTOK not avaliable? The PAM_AUTHTOK and PAM_OLDAUTHTOK items can be used to pass authentication tokens (passwords) from one module to another. However, they are avaliable only to PAM modules and not to PAM applicatinos. If you have a special setup in which you really need to preset the password from the application (e.g. using a radius server) then you can use the pam_set_authtok module avaliable from http://www.uni-hohenheim.de/~schaefer/linux/pam/pam_set_authtok.html <http://www.uni- hohenheim.de/~schaefer/linux/pam/pam_set_authtok.html>. SEE ALSO
Authen::PAM AUTHOR
Nikolay Pelov <NIKIP at cpan.org> COPYRIGHT
Copyright (c) 1998-2005 Nikolay Pelov. All rights reserved. This file is part of the Authen::PAM library. This library is free software; you can redistribute it and/or modify it under the same terms as Perl itself. perl v5.14.2 2005-06-30 PAM::FAQ(3pm)
All times are GMT -4. The time now is 08:43 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy