How to pass the pwd to an export command through script?


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting How to pass the pwd to an export command through script?
# 1  
Old 10-15-2011
How to pass the pwd to an export command through script?

I have an export command which exports the file which I specify to the specified location. It asks for an pwd and again to confirm the pwd, can some one help me to pass the pwd thru the script.

cd /opt/var/SecureTransport/bin
xml_export /opt/SecureTransport/var/logs/accounts_log.xml
account123
account123


the account123 which appears twice is the pwd and the confirm pwd, I want to pass this thru the script.
# 2  
Old 10-16-2011
No guarantee... still give it a shot...

Code:
echo -e "passwd1 \n passwd2" | xml_export  /opt/SecureTransport/var/logs/accounts_log.xml

--ahamed
# 3  
Old 10-16-2011
Quote:
Originally Posted by ahamed101
No guarantee... still give it a shot...

Code:
echo -e "passwd1 \n passwd2" | xml_export /opt/SecureTransport/var/logs/accounts_log.xml

--ahamed
No Luck. the enter password prompt goes in to indefinite loop.
# 4  
Old 10-17-2011
try expect utility ..
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Pass Arguments to Command from Shell Script

Hi all, I am working on a project, in which I have to connect to Bluetooth low energy device. I am able to connect and do data transfer from command line. But I want to do from script Here is my script #!/bin/bash #sudo hcitool -i hci0 lescan sleep 1 sudo hcitool -i hci0 lecc --random... (8 Replies)
Discussion started by: nithin@embdes
8 Replies

2. Shell Programming and Scripting

Help with 'pwd' command

Dear all, I am trying to use 'pwd' command in following way. current_directory == /dirA/dirB/test/dirC if ; then do this fi I am not sure how to pass this in command way. Please help! thanking you, emily (10 Replies)
Discussion started by: emily
10 Replies

3. Shell Programming and Scripting

Unable to pass send command in shell script

I am trying to automate a testcase . I am installing some software and it waits for user input after displaying "Do you want to continue ? " I am trying to do this in shell scripting. #!/bin/bash #!/usr/bin/expect -f /usr/bin/expect << EOF spawn apt-get install openjdk-7-jdk expect "*Do you... (1 Reply)
Discussion started by: Abdul Navaz
1 Replies

4. Post Here to Contact Site Administrators and Moderators

Unable to pass shell script parameter value to awk command in side the same script

Variable I have in my shell script diff=$1$2.diff id=$2 new=new_$diff echo "My id is $1" echo "I want to sync for user account $id" ##awk command I am using is as below cat $diff | awk -F'~' ''$2 == "$id"' {print $0}' > $new I could see value of $id is not passing to the awk... (0 Replies)
Discussion started by: Ashunayak
0 Replies

5. Shell Programming and Scripting

How can I pass arguments to system command in a awk script?

Hi I need your help, please How can I pass arguments to system command in a awk script?... for example: byte=substr(cadena,pos,2); system("grep -n byte mapeo.txt"); Does it exist a way? Thanks for advance. (4 Replies)
Discussion started by: solaris21
4 Replies

6. UNIX for Dummies Questions & Answers

How to pass command line argument in shell script?

I need to write a shell script, when I run that script I should pass those arguments if not, then script should not run and pass the error message like invalid option - - should pass the argument. and Exit from the script (8 Replies)
Discussion started by: Nsharma3006
8 Replies

7. Shell Programming and Scripting

How to pass command line argument in shell script?

I need to write a shell script, when I run that script I should pass those arguments if not, then script should not run and pass the error message like invalid option - - should pass the argument. and Exit from the script https://www.unix.com/images/misc/progress.gif (1 Reply)
Discussion started by: Nsharma3006
1 Replies

8. 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

9. Red Hat

How to pass value of pwd as variable in SED to replace variable in a script file

Hi all, Hereby wish to have your advise for below: Main concept is I intend to get current directory of my script file. This script file will be copied to /etc/init.d. A string in this copy will be replaced with current directory value. Below is original script file: ... (6 Replies)
Discussion started by: cielle
6 Replies

10. AIX

sync samba pwd with aix5.3 pwd

currently, my samba login works just fine. i want my clients to use aix5.3 account to login to samba so they don't have to change samba pwd and aix pwd. i googled, and vi /usr/lib/smb.conf per some of knowledge base, but i could not get to work. aix5.3 and samba 3.0.24.0 thanks in advace..... (2 Replies)
Discussion started by: tjmannonline
2 Replies
Login or Register to Ask a Question