Sponsored Content
Top Forums Shell Programming and Scripting how can I modify this script. Post 302460657 by rajkumar_g on Thursday 7th of October 2010 08:30:55 AM
Old 10-07-2010
how can I modify this script.

hello forum members,

I have a script which is used find the Uname and passwords and redirects into a output.txt file.I hardcoded a string "ciadev" but iwant search two more strings also "absdev" and "absprod" So modify this script please.
I am lookinmg forward from you,
please find the below script.
Code:
#! /bin/ksh 
echo "Weclome" 
if [ -d final ] 
then 
        rm -rf final #clean the exsisting o/p file 
        mkdir final 
        echo ""User id" "Password"      " >final/output.txt 
else 
        mkdir $HOME/final 
        echo ""User id" "Password"      " >final/output.txt 

fi 
for TEMP in `find . -type f` 
do 
        if [ "$TEMP" != "$0" ] 
        then 
                op=`grep Ciadev $TEMP | cut -d '-' -f 3,4 | sed 's/uCiadev/Ciadev/g' | sed 's/-P//g'` 
                echo $op >> $HOME/final/output.txt 
        fi 
done 
echo "show over bye"



Thanks in Advance
Rajkumar g

Last edited by Franklin52; 10-07-2010 at 10:17 AM.. Reason: Please use code tags, thank you!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Is it possible in a shell script to modify itself ??

We are running a quiz and the data collected from the quiz is submitted to the database. My requirement is to write a shell script to get these submitted records. I should be able to run this shell script at any time and the records it returns should be the ones submitted after the script was... (5 Replies)
Discussion started by: sehgalniraj
5 Replies

2. UNIX for Dummies Questions & Answers

Using a script to modify the crontab

I want to add one line to the end of my crontab using a script. I have tried piping in the editor commands, but I can't get it to work. crontab -e user << EX $a This is the text I want to add. . wq EX This doesn't work. Is there an easier way to do this? (2 Replies)
Discussion started by: johnmsucpe
2 Replies

3. Shell Programming and Scripting

Modify Perl script to work with txt - Permissions script

Hi I have this code, and i want work with a ls -shalR output in .txt What i need read to do this?? Where start? #!/usr/bin/perl # Allrights- A perl tool for making backups of file permissions # Copyright (C) 2005 Norbert Klein <norbert@acodedb.com> # This program is free... (1 Reply)
Discussion started by: joangopan
1 Replies

4. Shell Programming and Scripting

Please help to modify my script

Hi, I have a script which connect to ATM's and pull two files from the ATM. The which i try to pull is like PIC20085200001*.JPG First 7 digit consist of year montn and date as well After todays execution i want to change the date to next date I add few lines in the script but it is not... (6 Replies)
Discussion started by: Renjesh
6 Replies

5. Shell Programming and Scripting

script to modify /etc/shadow

Hi I am looking for script to modify /etc/shadow. For example: 1-)User enters username 2-)The line of that user is found in /etc/shadow and *LK* is added infront of the second field in /etc/shadow. How can I do this? Thanks (7 Replies)
Discussion started by: tjay83
7 Replies

6. Solaris

Need help with script when trying to modify user

The script get a csv file with 2 colls for example: 123456,UNIX 963852,Microsoft the script supose to put the number in the Description of the user in this case UNIX or Microsoft the error i get is does not exist.OR: UNIX does not exist.OR: Microsoft but the users exist so i do not... (7 Replies)
Discussion started by: shatztal
7 Replies

7. Shell Programming and Scripting

Modify /etc/passwd via script

We have a business need to modify the /etc/passwd file every time a new user gets added, because the user ID begins with a zero. When you create the new user in smit, even if you put the leading zero in, it does not retain it when the entry is added. That being said, I need to create a script... (11 Replies)
Discussion started by: mshilling
11 Replies

8. Shell Programming and Scripting

Help me to modify my script in stdout

please help me to modify my script #! /bin/bash while read line do echo "$line" >>/tmp/result && mysql -ss -e "use $line; select count(*) from users where type='admin' and deleted = 0;" > /tmp/result; done < /tmp/db_data cat result alan_hardwsdefs 2 bgrmods 2 claudiatdsefs 1... (2 Replies)
Discussion started by: unimaxlin
2 Replies

9. Shell Programming and Scripting

Modify sed script

I'm trying to take out strings from log files and add them to a csv. For example, in the directory now, there are 2 log files. I get the following results: sed -e '/custodian/b' -e '/packaged by/b' -e '/package name/b' -e '/Total Data (MB) Read/b' -e '/Begin Time/b' -e d * packaged by =... (10 Replies)
Discussion started by: chipperuga
10 Replies

10. Shell Programming and Scripting

Modify the file by script

Hi All, I have an input file like below, 6984 1225 6989 1220 6994 1214 ... (3 Replies)
Discussion started by: Indra2011
3 Replies
PAM-SCRIPT(7)						 Miscellaneous Information Manual					     PAM-SCRIPT(7)

NAME
pam-script - a PAM module that can invoke scripts within the PAM stack. SYNOPSIS
pam-script.so [onerr=(success|fail)][dir=/some/path/] DESCRIPTION
pam-script allows you to execute scripts during authorization, passwd changes, and on session opening or closing. Such scripts can perform necessary tasks or influence the outcome of the PAM stack. For example, if the following entry was included in pam.conf sshd auth required pam_script then if the script, pam_script_auth, exits with a non-zero value this would cause the user to be denied SSH access to the machine. OPTIONS
A summary of options is included below. onerr=(success|fail) the default behavior if the module can not find or execute the script. The default is to fail if the option is not given. dir=/some/path/ where to find the pam-scripts to invoke for each of the various module-types as described below. The default is dir=/usr/share/lib- pam-script if not given. List of scripts pam_script_auth Executed under auth which handles the authentication stage of establishing the user via some challenge-response (i.e. username/pass- word) pam_script_acct invoked under account module-type for non-authentication based account management. pam_script_passwd invoked under passwd for changing the password tokens. pam_script_ses_open invoked when a session is first opened. pam_script_ses_close run after a session is first closed. All the scripts will be passed several environment variables: PAM_USER, PAM_RUSER, PAM_RHOST, PAM_SERVICE, PAM_AUTHTOK, PAM_TTY, and PAM_TYPE referring to the module-type. The pam_script.so arguments in the pam.conf will be passed on the command line, which can be used to modify the script behavior. FILES
/lib/security/pam_script.so - the PAM module /usr/share/libpam-script - where the scripts should be placed by default VERSION
pam-script 1.1.5 SEE ALSO
PAM(7) and the PAM "The System Administrators' Guide" AUTHOR
pam-script was written by Jeroen Nijhof <jeroen@jeroennijhof.nl> with some additions and modifications by R.K. Owen, Ph.D. <rkowen@nersc.gov>. This manual page was written by R.K. Owen <rkowen@nersc.gov>, for the Debian project (but may be used by others). August 22, 2007 PAM-SCRIPT(7)
All times are GMT -4. The time now is 01:36 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy