Sponsored Content
Top Forums Shell Programming and Scripting Provide 2 inputs when prompts Post 302863779 by prasanna2166 on Tuesday 15th of October 2013 06:02:17 AM
Old 10-15-2013
Provide 2 inputs when prompts

Hi All,

I am a novice to UNIX, i need to know is there a way to provide 2 inputs when the shell prompts and i need to assign those 2 values to 2 separate variables. I dont want to give those values as a arguments (while running the script).

Thanks in advance!!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rsh help with remote prompts

Hi, I'm writing a shell script that rsh's onto a remote machine and runs a perl script that requires values to be entered as the script executes. I also need to ba able to see the outputs from the perl script. When I try to run it I get an stty : Invalid argument and understand that this is... (4 Replies)
Discussion started by: ianf
4 Replies

2. Shell Programming and Scripting

scripting password prompts

Hi there Probably a really simple question but I am writing an install script and at certain stages of the install (ie creating a table in mysql) the system prompts for you to enter a password, I was wondering, how do I script this input so that the install doesnt keep stopping for manual... (3 Replies)
Discussion started by: hcclnoodles
3 Replies

3. UNIX for Advanced & Expert Users

password prompts

I would like to log all the commands that are entered on an ssh client. I can do this successfully, however, I dont want to log user logins and passwords. Is there any way to identify passwords and avoid them? For example, I can look for a string 'password:' and ignore everything until a nl/cr. Is... (2 Replies)
Discussion started by: balag
2 Replies

4. Shell Programming and Scripting

working in different prompts

hi i want a script which would invoke a different prompt and execute commands in that prompt and comes back. Is it possible? (3 Replies)
Discussion started by: gopsman
3 Replies

5. UNIX for Dummies Questions & Answers

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (1 Reply)
Discussion started by: mmg2711
1 Replies

6. Shell Programming and Scripting

Shell Program that prompts for user Id

Hi I have a question that after trying tirelessly I cant solve. I'm not great wth UNIX and wonder if anyone could help. I have to create a shell program using functions that prompts for a user ID. I must then verify that the user Id corresponds to an account on the system. If a legal user Id is... (16 Replies)
Discussion started by: mmg2711
16 Replies

7. AIX

Deleting a file prompts for a Yes or No

Hi.. I have been asked to delete files in a certain directory in our AIX server, but the problem is, there are over 1000 files to delete. I am prompted by a yes (y) or a no (n) each time and i don't wanna type in a 'y' a thousand times.. :-( Is there a command that i can use to make things faster?... (1 Reply)
Discussion started by: chipahoys
1 Replies

8. Shell Programming and Scripting

Expect scripting not seeing the screen prompts.

Someone recommended using an expect script for an issue I was having so I tried writing one but of the 3 expected prompts on the screen, it only see responds to the first one. The code is: ==================================== #!/usr/local/bin/expect -f spawn /usr/local/bin/rcs -u1.1 xyz.fmb... (1 Reply)
Discussion started by: pjones006
1 Replies

9. Shell Programming and Scripting

How to provide auto inputs for a sub-script within a script?

Hi All, I am writing a shell script. #!/bin/bash cat /etc/hosts mkdir -p /var/tmp mount 113.123.35.37:/vol/vol615/syb /var/tmp In above script I am trying to add below predefined script/command (/var/tmp/db_tools) This command in turn ask for user input, which will be always option... (17 Replies)
Discussion started by: madhur.baharani
17 Replies

10. UNIX for Beginners Questions & Answers

Using tee command with ablity to provide input for prompts

OS version: RHEL 7.4 Shell : bash I would like to capture command outputs using tee like # yum upgrade | tee yumupgradeLog But, if I use tee command, I cannot respond to prompts like Is this ok : during command execution as shown below. Is there a way I could use tee and still be able to... (4 Replies)
Discussion started by: kraljic
4 Replies
alias(1)						      General Commands Manual							  alias(1)

NAME
alias - Defines or displays aliases SYNOPSIS
alias [-tx] [alias-name[=string...]] Note The C shell has a built-in version of the alias command. If you are using the C shell, and want to guarantee that you are using the com- mand described here, you must specify the full path /usr/bin/alias. See the csh(1) reference page for a description of the built-in com- mand. STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: alias: XCU5.0 Refer to the standards(5) reference page for more information about industry standards and associated tags. OPTIONS
[Tru64 UNIX] Sets or lists tracked aliases. [Tru64 UNIX] Sets or lists exported aliases. Note See the ksh(1) reference page for a description of tracked and exported aliases. OPERANDS
Prints the alias definition on standard output. Assigns the value of string to the alias alias-name. If no options and no operands are specified, all alias definitions are printed on standard output. DESCRIPTION
The alias utility creates or redefines alias definitions or writes the values of existing alias definitions to standard output. An alias definition provides a string value that replaces a command name when it is encountered. An alias definition affects the current shell execution environment and the execution environments of the subshells of the current shell. When used as described, the alias definition will not affect the parent process of the current shell nor any utility environment invoked by the shell. NOTES
[Tru64 UNIX] This reference page describes the creation and maintenance of aliases. See the Command Aliasing section of the ksh(1) or sh(1p) reference pages for the description of alias substitution. RESTRICTIONS
[Tru64 UNIX] If you use either the -t option or the -x option, you must use at least one alias-name or alias-name=string operand. [Tru64 UNIX] Aliasing is performed when scripts are read, not while they are executed. Therefore, for an alias to take effect, the alias definition command has to be executed before the command that references the alias is read. [Tru64 UNIX] Aliases can be used to redefine special built-in commands but cannot be used to redefine the reserved words listed in the ksh(1) reference page. EXIT STATUS
The following exit values are returned: Successful completion. One of the name operands specified did not have an alias definition, or an error occurred. EXAMPLES
Change ls to give annotated output in columns: alias ls="ls -CF" Create a simple redo command to repeat previous entries in the command history file: alias r='fc -s' Cause du to use 1K units instead of the default 512-bytes: alias du=du -k Set up nohup so that it can deal with an argument that is itself an alias name: alias nohup="nohup " ENVIRONMENT VARIABLES
The following environment variables affect the execution of alias: Provides a default value for the internationalization variables that are unset or null. If LANG is unset or null, the corresponding value from the default locale is used. If any of the internationalization vari- ables contain an invalid setting, the utility behaves as if none of the variables had been defined. If set to a non-empty string value, override the values of all the other internationalization variables. Determines the locale for the interpretation of sequences of bytes of text data as characters (for example, single-byte as opposed to multibyte characters in arguments). Determines the locale for the format and contents of diagnostic messages written to standard error. Determines the location of message catalogues for the processing of LC_MES- SAGES. SEE ALSO
Commands: csh(1), ksh(1), Bourne shell sh(1b), POSIX shell sh(1p), unalias(1) Standards: standards(5) alias(1)
All times are GMT -4. The time now is 10:54 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy