if $LOGIN found in file then execute X - help!


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers if $LOGIN found in file then execute X - help!
# 1  
Old 10-16-2007
if $LOGIN found in file then execute X - help!

Hello,
I'm trying to do specific actions based on whether a string is contained within a file or not. More specifically, I'm using the $LOGIN variable to compare to a user_list plain text file to determine what auto login process to execute for the specific user.

I've seen several posts using the following format to determine if a string is contained within the specific file name, but I'm having issues putting this into a conditional loop to execute the different login processes.

find . -name 'user_list.txt' -exec grep -ilw "$LOGIN" {} \;
This outputs the filename when the $LOGIN is contained and outputs nothing if it isn't, but I can't figure out a way to use this info.

Any input or ideas would be greatly appreciated. Smilie

Additional info: OS - AIX 5.3 using k-shell

Thanks
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Execute shell script and if string found while executing then exit

Hi All, I have one shell script start.sh which executes another shell script test.sh something like below :test.sh -param1 -param2 In the test.sh there is one command for removing file:rm file1.bak I want whenever I execute start.sh, it will execute test.sh and if it finds string rm... (7 Replies)
Discussion started by: ORAI
7 Replies

2. Shell Programming and Scripting

Login to remote host and execute commands

Hi, i want to write script where it will login into 50 hosts and if login is successful it print message "login to host1 is successful" if not it should print message "Not able to login to host1". once connection to the host is succesful it should fire df command to check filesystem if df is... (3 Replies)
Discussion started by: amru8810
3 Replies

3. Solaris

Found a Sun Ultra 10 Elite3D workstation, and it boots to a login screen. How can I reset the OS?

I just got moved to a new office building, and as I was unpacking my stuff I saw an odd tower PC in the nearby recycling heap. It turned out to be a Sun Ultra 10 Elite3D workstation, complete with keyboard, mouse, and monster-sized CRT with the wacky Sun video cable. I just set everything up and... (4 Replies)
Discussion started by: wowbobwow
4 Replies

4. Shell Programming and Scripting

Script for login to servers with user name and password and execute commands

I am having the 15 servers which need to do the monitoring Hi I need a shell script, By which i can log in to multiple servers and execute the commands.. I need to specify the username and password in the scripts. Please help me to write the script so that it can login with username and... (5 Replies)
Discussion started by: nandan8a
5 Replies

5. Shell Programming and Scripting

When i am trying to execute export command within a shell script it is saying command not found.

I am running the export command within a view to use that value inside my build script. But while executing it it is saying "export command not found" My code is as follows: -------------------------- #!/bin/sh user="test" DIR="/bldtmp/"$user VIEW="test.view1" echo "TMPDIR before export... (4 Replies)
Discussion started by: dchoudhury
4 Replies

6. Shell Programming and Scripting

Modify a file by another file: add new line and variable after string is found

hello, I have problem with writing/adjusting a shell script. I searched forum and unfortunately couldn't write scipt based on the information I found. I never wtire such so it's hard for me and I do need to modify one script immediately. case looks like: 1. 'file' that needs to be modified... (3 Replies)
Discussion started by: bipbip
3 Replies

7. Shell Programming and Scripting

Delete a pattern present in file 2 from file 1 if found in file 1.

I have two files File1 ==== 1|2000-00-00|2010-02-02|| 2| 00:00:00|2012-02-24|| 3|2000-00-00|2011-02-02|| File2 ==== 2000-00-00 00:00:00 I want the delete the patterns which are found in file 2 from file 1, Expected output: File1 ==== (5 Replies)
Discussion started by: machomaddy
5 Replies

8. Shell Programming and Scripting

Execute script if a file is found

I'm trying to get the following to look for the newest powerpoint presentation and if it finds something then run a shell script named star_presentation.sh and if it doesn't then simply exit. Any help would be greatly appreciated. #!/bin/bash ppts=/ticker/powerpointshare find $ppts... (3 Replies)
Discussion started by: binary-ninja
3 Replies

9. Shell Programming and Scripting

login into root from user and execute command through script

i have logged in as user. I want to write a script to login into root and execute commands for eg. ifconfig or other command. kindly help me out. (6 Replies)
Discussion started by: pradeepreddy
6 Replies

10. Shell Programming and Scripting

Need to execute 2 scripts, wait, execute 2 more wait, till end of file

:cool: I need to execute a shell script to do the following: cat a file run two back ground processes using the first two values from the file wait till those background processes finish run two more background processes using the next two values from the file wait till those background... (1 Reply)
Discussion started by: halo98
1 Replies
Login or Register to Ask a Question
Authen::SASL::Perl::LOGIN(3)				User Contributed Perl Documentation			      Authen::SASL::Perl::LOGIN(3)

NAME
Authen::SASL::Perl::LOGIN - Login Authentication class SYNOPSIS
use Authen::SASL qw(Perl); $sasl = Authen::SASL->new( mechanism => 'LOGIN', callback => { user => $user, pass => $pass }, ); DESCRIPTION
This method implements the client and server part of the LOGIN SASL algorithm, as described in IETF Draft draft-murchison-sasl-login-XX.txt. CALLBACK The callbacks used are: Client user The username to be used for authentication pass The user's password to be used for authentication Server getsecret(username) returns the password associated with "username" checkpass(username, password) returns true and false depending on the validity of the credentials passed in arguments. SEE ALSO
Authen::SASL, Authen::SASL::Perl AUTHORS
Software written by Graham Barr <gbarr@pobox.com>, documentation written by Peter Marschall <peter@adpm.de>. Server support by Yann Kerherve <yannk@cpan.org> Please report any bugs, or post any suggestions, to the perl-ldap mailing list <perl-ldap@perl.org> COPYRIGHT
Copyright (c) 2002-2004 Graham Barr. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. Documentation Copyright (c) 2004 Peter Marschall. All rights reserved. This documentation is distributed, and may be redistributed, under the same terms as Perl itself. Server support Copyright (c) 2009 Yann Kerherve. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. POD ERRORS
Hey! The above document had some coding errors, which are explained below: Around line 175: Unknown directive: =over4 Around line 177: '=item' outside of any '=over' perl v5.16.3 2010-06-02 Authen::SASL::Perl::LOGIN(3)