People, I really have two problems in one. Basicly "option 2" is the one I wish to persue but "option 1" will do for now....
Option 1
I have an expect script. I would like it to read (open ) a crypted file with out creating a decrypted file from the source (crypted file) then open and read the flat file.... any ideas....?
Option 2
I can do this from with in a standard UNIX script - no problem
ie (eval `crypt key </tmp/filename`)
Question.....
How do I (or can I) execute "expect" commands from with in the shell script (Without running a third external expect scrpit) and pass the shell varibales required to the expect code from with in the shell script?
Back ground.
The crypted file format is thus....
userid="myid"
password="mypass"
commnet="This is a comment"
Thanks
Andrek
Last edited by Andrek; 08-28-2006 at 12:56 AM..
Reason: typo in heading
Assuming I got what your problem is:
This way the password to decrypt the file is not in any script, nor does is it on the commandline to allow ps -ef to show it.
If you have to use expect, then create the expect script as a here document
with the password input varaible -- input the same as part of the code above. A priori, expect looks like a messier solution overall. But I dunno what your requirements are.
Hi, Thanks for the info. I can get the UserID and Password from the crypted file inside a unix sh (/usr/bin/ksh) because the crypted file format is....
Userid="xxx"
passwd="aaa"
comments="bbb ccc ddd"
etc
the eval 'crypt key <$cryptfile command will do that for me.
ie $Userid is created and set to xxx.
The problem is.
The old way of doing things is an expect script opens the $userfile and reads gets the password and userid etc etc. This leaves a normal file on the system with a userid and password available to been seen. (The file is deleted once all processing has been completed)
The new way is to have the $userfile crypted so that if the file is left behind on the system no one can view the userid and password details.
The system in question is on a secure (outside the DMZ) , thus direct login is strictly is limited and my task is to create a script that will allow 1st level UNIX staff to create secure ftp logins on that server with out logging.
It all works fine but we need to work with a crypted file. Therefor my expect skills are low and I need to complete this task very soon.
So I'm stumped.
First... APOLOGIES... my work is offline in an office that has zero internet connectivity, as required by our client. If need be, I could print out my script attempts and retype them here. But on the off chance... here goes.
I have a text file (file_source) of terms, each line... (3 Replies)
hi guys, i want help... Reding XML file and print the values into the text file using linux shell script file as per below xml file
<sequence>
<Filename>aldorzum.doc</Filename>
<DivisionCode>US</DivisionCode>
<ContentType>Template</ContentType>
<ProductCode>VIMZIM</ProductCode>
</sequence>... (1 Reply)
Hey Guys ,
iam trying to match to string in TCL scripts but it not working .
Its only working true condition to print yes.. When condtion fail then even it prints YES
Any suggestion this ??
if {} {
puts"yes" ... (3 Replies)
Hi,
I am a beginner in scripting...I have to do a script where I have to read a file which has list of job names, line by line and for every line execute a dsjob command to find the log details of the job and extract only the start time of the job, if it is greater than jan 01 2008 and create... (1 Reply)
Can someone please help me to write script for following scenario :
1> script should read a input .csv file of format : EmpName, PF, Leave, Basic ,HRA
2> another config file ( may be again a .csv file ) has format EmpName and EmpID
3> script should read another config file for each EmpName in... (3 Replies)
Hi
How can i dynamically read files names from a list file and execute them from a single shell script.
Please help its urgent
Thanks in Advance (4 Replies)
hi,
I have a file containing names, say n number of names,
sample file
robin
smith
dallas
frey
cook
all these names are in a file name called names.txt and it is placed in a directory called /data/names
all i want is to write a script, which will read from the file and gives the... (3 Replies)
Hi,
I'm trying to read a file in with and assigne the stream to a char * type. I've manged it using the cin.get returning type char, but am having run-time problems returning a char *. For example,
char *pStream = "file.txt";
ifstream from(pStream);
from.open(pStream);
... (1 Reply)