01-21-2011
Bash answer prompt
I am working with a script to simplyfy some operations where I work, but one of the programs needs me to enter a password.
It will as me "Please enter the administrator password:"
Is there a way to make a bash script to automatically answer the question with the needed password?
I am looking at either have the password in clear text directly in the script, or read the script from a file only readable by a certain user.
I know, none of them are "secure" as the password prompt is there to create security, but the security is not really needed for us, right now it's more a bother to us.
I have been trying with things such as:
# program remove -Uadmin < /home/user/passwd_file
or as another suggestion was:
# yes password | program remove -Uadmin
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
in csh I was using:
set prompt=""$HOSTNAME".tk.\!> "
to customize the look of my prompt. I have seen the light after reading the perils of csh scripting and wish to switch to bash. How do I customize my bash prompt??? I've tried many variation of the above w/no success, and searching this... (2 Replies)
Discussion started by: yankee428
2 Replies
2. Shell Programming and Scripting
It looks like,
user@hostname:/auto/home3/user$
Desired,
user@hostname$
I added following line in .bashrc, but still its same.
export PS1=" $ "
Please help me :confused: (13 Replies)
Discussion started by: admax
13 Replies
3. UNIX for Advanced & Expert Users
Hi,
Does anyone know any way of making bash prompt extended with conditional content?
Example:
export PS1="] && echo '#' || echo '\$'" # This won't work - prompt is not executed
# export PS1="\$" # This is an existing but also working equivalent
I would like to use more complex... (8 Replies)
Discussion started by: adderek
8 Replies
4. OS X (Apple)
I'm using a custom prompt with PS1 in my .profile. It is
PS1="\\u@\e\:\W\ \\$\ \"
and it works well, as you can see,
http://content.screencast.com/users/killer54291/folders/Jing/media/2b3db52a-ebf7-43e2-95cc-f45dadbc2b98/00000023.png
but, when i type more than the width of the window, it... (0 Replies)
Discussion started by: killer54291
0 Replies
5. Shell Programming and Scripting
This is an instance of "if it's not one thing, it's another."
I recently fell victim to my own stupidity in trashing, by accident, my long-running and very highly-customized .bash_profile and .bashrc files for Cygwin & Cygwin/X. I had backups from a previous "go" with this, and decided to use... (0 Replies)
Discussion started by: SilversleevesX
0 Replies
6. Shell Programming and Scripting
I'm trying to write a script the simplifies the execution of a program:
After starting the program (sh ~/.mfix/model/make_mfix) I am prompted four times for options:
Do you need SMP version? (y/n)
Do you need DMP version? (y/n)
Do you need debug version? (y/n)
Force re-compilation of... (2 Replies)
Discussion started by: lanew
2 Replies
7. UNIX for Dummies Questions & Answers
Hi,
I have a custom prompt in Bash. However, I would like to further customise it so that it shows me the date and time. However, I would like this new addition to appear on the right side of the terminal window.
The idea behind this is to "visually balance" some data on the right as most of... (2 Replies)
Discussion started by: vnayak
2 Replies
8. Shell Programming and Scripting
I remember there was a gnome only command that we could insert in a bash script to mount a Linux disk that would pop up a little window to grab a password.
I know there are bash commands to read a string but they are not GUIs and they echo the characters typed. This gnome command popped up a... (1 Reply)
Discussion started by: siegfried
1 Replies
9. UNIX for Dummies Questions & Answers
Hello Guys,
I have facing problem with linux shell prompt .Am expecting my Bash prompt to be like below
but its showing like
~]$ ot@Servername and while typing the commands the prompt looks like below:
~]$ echo $PS1
$
~]$ ot@ServernameChecked the .bash_profile and also changed... (9 Replies)
Discussion started by: kapil514
9 Replies
10. Shell Programming and Scripting
I use the .bashrc file from this thread.
Direct link to the archive containing the ultimate bashrc
I am trying to use autojump, but it will not autoload the directories to the autojump list as the custom prompt is not compatible.
Here is the thread on the issue from other users.
apt -... (2 Replies)
Discussion started by: genehunter
2 Replies
LEARN ABOUT CENTOS
schema-reload.pl
SCHEMA-RELOAD.PL(8) System Manager's Manual SCHEMA-RELOAD.PL(8)
NAME
schema-reload.pl - Directory Server perl script for updating the schema.
SYNOPSIS
schema-reload.pl [-Z serverID] [-D rootdn] { -w password | -w - | -j filename } [-P protocol] [-d schemadir] [-v] [-h]
DESCRIPTION
Manually reloads the schema files used by the Directory Server instance, either in the default location, or in user-specified locations.
OPTIONS
A summary of options is included below:
-Z Server Identifier
The server ID of the Directory Server instance. If there is only one instance on the system, this option can be skipped.
-D Root DN
The Directory Manager DN, or root DN. If not specified, the script will search the server instance configuration for the value.
-w password
The rootdn password.
-w -
Prompt for the rootdn password.
-j password filename
The name of the file that contains the root DN password.
-d schemadir
Gives the full path to the directory where the schema file is located. If this is not specified, the script uses the default schema
directory, /etc/dirsrv/schema.
-P protocol
The connection protocol to connect to the Directory Server. Protocols are STARTTLS, LDAPS, LDAPI, and LDAP. If this option is
skipped, the most secure protocol that is available is used. For LDAPI, AUTOBIND is also available for the root user.
-v
Display verbose ouput
-h
Display usage
EXAMPLE
schema-reload.pl -Z instance3 -D 'cn=directory manager' -w password -P STARTTLS -d /LDAP/schema/
Note: security must be enabled to use protocol STARTTLS. If STARTTLS is not available it will default to next strongest/available
protocol automatically.
DIAGNOSTICS
Exit status is zero if no errors occur. Errors result in a non-zero exit status and a diagnostic message being written to standard error.
AUTHOR
schema-reload.pl was written by the 389 Project.
REPORTING BUGS
Report bugs to http://bugzilla.redhat.com.
COPYRIGHT
Copyright (C) 2013 Red Hat, Inc.
Mar 5, 2013 SCHEMA-RELOAD.PL(8)