12-29-2005
Hmm, I overlooked your question. You said shell script. I bliv it wont be easy doing it in a shell script. You can use something like this
========================================
echo "Enter password: \c"
stty -echo
read a
echo "$a" > pwd.txt
crypt encry_key < pwd.txt > pwd.x
rm pwd.txt
stty echo
echo " Password is \c"
crypt encry_key < pwd.x
========================================
However, the problem here is the encryption key (encry_key or any other string) can be easily seen to those who can read the script. Any person who can execute this script can also read it, So in short anyone who can execute this script, can also know the encrption key and thus can also read the encrypted password file.
So, your best bet would be to resort to c programs.
But my knowledge is limited, may be someone on the forum has some good idea here
10 More Discussions You Might Find Interesting
1. UNIX for Advanced & Expert Users
#Author : kkodava
#!/usr/bin/ksh
#Use of this program is You can findout the no of days & day of starting and ending dates
#usage no_of_days startdate<yyyymmdd> enddate<yyyymmdd>
syy=`echo $1|cut -c1-4`
smm=`echo $1|cut -c5-6`
sdd=`echo $1|cut -c7-8`
eyy=`echo $2|cut -c1-4`
emm=`echo... (1 Reply)
Discussion started by: krishna
1 Replies
2. Programming
hi..
this is my question:
it is possible transfer parameters from my program written in C to a .ksh script?
how can i do it?
i have a program in C, what is called from a .ksh script, and i need what the C program returns some values (parameters)
please, help me - any idea
thanks
... (2 Replies)
Discussion started by: DebianJ
2 Replies
3. Shell Programming and Scripting
Hi,
is there problem with grep command when using ksh?
I had the below command:
/usr/bin/grep \""$Mon $NewDD\"" /tmp/timemanager/intlog.$$ >> /tmp/timemanager/log.$$ 2>/dev/null
when I run ksh in debug mode, this command can not grep anything even the data is in the file.
+ /usr/bin/grep... (3 Replies)
Discussion started by: cin2000
3 Replies
4. AIX
I am new to AIX. I was wondering if there is a security API on AIX which I can call from my C program to validate the userID and password of a user.
My plan is to have my C program prompt the user for UserID and password. I'll then call the AIX security API to determine what authority the user... (1 Reply)
Discussion started by: AIX_user
1 Replies
5. Shell Programming and Scripting
Hi all,
Can I invoke a perl script from Ksh script and pass parameters to the perl script.
Please do help me..
thanks
Maha (10 Replies)
Discussion started by: mahalakshmi
10 Replies
6. Shell Programming and Scripting
Hi,
I have written Expect script that takes root password as argument, and executes another script. The another script prompts for password, which Expect feeds. But Expect shows the password on stdout and in the log. Is there a way to suppress it? (1 Reply)
Discussion started by: illcar
1 Replies
7. Shell Programming and Scripting
Hi Guys...is there a way to convert a .ksh script to .C program..? (3 Replies)
Discussion started by: aggars
3 Replies
8. UNIX for Dummies Questions & Answers
Hi I am new to unix and I am trying to figure out how to write a shell script with a login name and password. I want to do something along the lines of if both are correct it echoes "you are logged in" and if the password is wrong it echoes "wrong password" and same with the login name. I've tried... (7 Replies)
Discussion started by: thedemonhunter
7 Replies
9. Shell Programming and Scripting
Hi Guys,
We have a java program that basically install updates to an existing software. The java program consist of several screens asking user for choices (please see below for a detailed example)
*** Screen 1 ***
Please choose the operation you want to perform:
1. Install new... (5 Replies)
Discussion started by: maddmaster
5 Replies
10. Shell Programming and Scripting
Hi,
I have a text file with multiple sql statements in which I have pick only the below select update and delete statements and do print as given below.
All the select,update,delete statements will be as same as ( subquery with ().all statements ending with ; ) the examples given below.
1)... (19 Replies)
Discussion started by: manasa_vs
19 Replies
LEARN ABOUT OPENDARWIN
pwd
PWD(1) BSD General Commands Manual PWD(1)
NAME
pwd -- return working directory name
SYNOPSIS
pwd [-LP]
DESCRIPTION
The pwd utility writes the absolute pathname of the current working directory to the standard output.
Some shells may provide a builtin pwd command which is similar or identical to this utility. Consult the builtin(1) manual page.
The options are as follows:
-L Display the logical current working directory.
-P Display the physical current working directory (all symbolic links resolved).
If no options are specified, the -P option is assumed.
ENVIRONMENT
Environment variables used by pwd:
PWD Logical current working directory.
DIAGNOSTICS
The pwd utility exits 0 on success, and >0 if an error occurs.
STANDARDS
The pwd utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
SEE ALSO
builtin(1), cd(1), csh(1), sh(1), getcwd(3)
BUGS
In csh(1) the command dirs is always faster because it is built into that shell. However, it can give a different answer in the rare case
that the current directory or a containing directory was moved after the shell descended into it.
The -L option does not work unless the PWD environment variable is exported by the shell.
BSD
February 4, 2002 BSD