10-07-2008
Help how replace stardard keyboard inputs by arguments at run time of a script
Hello Everybody,
Please help.
I was trying to automate the use of a third-party given shell script. The script is written to be used at run-time to collect a few variables to be provided by the user through key board, in the fashion as below:
./runcommand
please provide a file name to dump the output:
then user type in the file name
please provide the user name:
then user type in the user name
please provide password
then user type in the password
please provide role:
then the uese type in the answer to the role
I want to run this command automatically without the user interactive input as I know in advance my answers to those questions.
Ideally like:
./runcommand file_name user_name user_password user_role
or something similar that the command does not wait for the user's interaction.
How can I do that?
Thanks in advance
--Dingrong
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi there,
It's pretty hard for me to explain my problem because I'm affraid I'm not using the correct vocabulary. So let me describe the situation. I wrote a script that has one argument. It works like this:
~$ cat /usr/local/bin/squote
echo "$@" | sed 's/'\''/'\''\\'\'\''/g; s/.*/'\''&'\''/g'... (2 Replies)
Discussion started by: chebarbudo
2 Replies
2. Shell Programming and Scripting
HI ,
I have a list1 which consists of data that i have to search and a list2 which has the files that need to be searched .So basically i am using list1 on list2 to see if list1 data is present if found replace it .I have written the code using foreach loop for each list .This is taking the... (1 Reply)
Discussion started by: madhul2002
1 Replies
3. Shell Programming and Scripting
Hi!
I want to run a script in parallel with different arguments.
eg.
start
script.sh argA script.sh argB script.sh argC
end
Can someone please tell how to achieve this.
Thanks in advance. (4 Replies)
Discussion started by: dummyix
4 Replies
4. Shell Programming and Scripting
Hello everyone,
I have two types of files in a directory:
*.txt
*.info
I have a perl script that uses these two files as arguments, and produces a result file:
perl myScript.pl abc.txt abc.xml
How can I run this script (in a "for" loop , looping through both types of files)... (4 Replies)
Discussion started by: ad23
4 Replies
5. Programming
i used a two-way linked list "node" for the code::
#include<stdio.h>
#include<malloc.h>
void insert();
void reverse();
struct node
{
char c;
struct node *next;
struct node *back;
}*start=NULL;
int main()
{
int n,i; (4 Replies)
Discussion started by: mscoder
4 Replies
6. Shell Programming and Scripting
echo $result=exec("./permit.sh".$_FILES);
pls suggest some other method to run shell script in php .:wall::mad: (0 Replies)
Discussion started by: upvan111
0 Replies
7. Shell Programming and Scripting
the scenario is -
If I pass 3 three arguments( run time) , it should list all .txt files from a path to temp file
if I pass 2 arguments ( run time) , it should list all .csv files from the same path to another temp file
the above scenario should be handled in single code and also I dont know ... (2 Replies)
Discussion started by: Prashanth B
2 Replies
8. Shell Programming and Scripting
Hi..!
I'm stuck with my automation of starting a process and keeping it running even after the current ssh session has exited..
So i'm trying to use command 'screen'. which is doing exactly what i wanted, But the problem is automation of the same.
i will have to press Ctrl+a and Ctrl+d for... (2 Replies)
Discussion started by: chandana hs
2 Replies
9. UNIX for Dummies Questions & Answers
I have a unix command that prompts for 'y'. How do I run this from my shell script? (4 Replies)
Discussion started by: Sree10
4 Replies
10. Windows & DOS: Issues & Discussions
Dear All,
I want to run a shell script with out logging to putty but configuring it to a keyboard short cut it windows PC. Can this be done? I want this to rename a log in a specified folder in a system
Thanks (8 Replies)
Discussion started by: Chi_SL
8 Replies
LEARN ABOUT SUNOS
create-file-user
asadmin-create-file-user(1AS) User Commands asadmin-create-file-user(1AS)
NAME
asadmin-create-file-user, create-file-user - createsa new file user
SYNOPSIS
create-file-user --user admin_user [--password admin_password] [--host localhost][--port 4848] [--secure|-s] [--passwordfile filename]
[--terse=false] [--echo=false] [--interactive=true] [--userpassword user_password] [--groups user_groups:[user_groups]*] [--authrealmname
auth_realm_name] user_name
Creates an entry in keyfile with the specified username, userpassword, and groups. Multiple groups can be created by separating them with a
colon ":". If the auth_realm_name is not specified, an entry is created in the default keyfile. If auth_realm_name is specified, an entry
is created in the keyfile where the auth-realm name in the domain.xml file points to.
This command is supported in remote mode only.
OPTIONS
--user authorized domain application server administrative username.
--password password to administer the domain application server.
--host machine name where the domain application server is running.
--port port number of the domain application server listening for administration requests.
--secure if true, uses SSL/TLS to communicate with the domain application server.
--passwordfile file containing the domain application server password.
--terse indicates that any output data must be very concise, typically avoiding human-friendly sentences and favoring well-
formatted data for consumption by a script. Default is false.
--echo setting to true will echo the command line statement on the standard output. Default is false.
--interactive if set to true (default), only the required password options are prompted.
--userpassword password for the file user.
--groups group where the file user belongs to.
--authrealmname name, in the domain.xml file, where you have different stores for file auth realm.
OPERANDS
user_name name of file user to be created.
EXAMPLES
Example 1: Using the create-file-user command
It is assumed that an authority realm has already been created using the create-auth-realm command.
asadmin> create-file-user --user admin1 --password adminadmin1
--host pigeon --port 5001 --userpassword sample --groups staff:manager
--authrealmname auth-realm1 sample_user
Command create-file-user executed successfully
Where: the sample_user is the file user created.
EXIT STATUS
0 command executed successfully
1 error in executing the command
asadmin-create-auth-realm(1AS)asadmin-delete-file-user(1AS), asadmin-list-file-users(1AS), asadmin-update-file-user(1AS), asadmin- list-
file-groups(1AS)
J2EE 1.4 SDK March 2004 asadmin-create-file-user(1AS)