It's best practice to have both the string in double quotes whenever you do string comparision
and use numeric comparision operator for numeric as below
Is it possible to change the color of text in a korn shell script Menu?
I can change the color of session text through my telnet client but I want to be able to change color text in the Korn shell menu to highlight certain items. (6 Replies)
I am attempting to create a shell script with the following capaciblities:
1. Listed options to choice from
2. Use to perform awk statements
3. Print a report with the awk results
My questions are
1. How do I select more than one file for option #5 and #6
2. How to I create an... (11 Replies)
Hi folks,
I have a dual-boot Ubuntu/Windows machine and I wanted to create a script to change the menu.lst file so it will change the default boot partition (this is so I can reload the machine remotely and allow it to boot to the Windows partition).
Today I have to sudo cp a template file I... (1 Reply)
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
1) Write a Menu Driven Shell Script which accepts1 to 5 options and performs the following actions for... (1 Reply)
hi guys, how would you do the following? I have a menu with 5 options in my shell script:
1. Run function 1 against files
2. Run function 2 against files
3. Run function 3 against files
4. Run function 4 against files
5. Run function 5 against files
I'd like to be able to run multiple... (10 Replies)
Hi,
I need to have a shell script for the below need.
1. Menu with one heading and 4 options.
2. the heading and 4 options are taken from a file.
File entry
======
Heading1|option1|option2|option3|option4|
Heading2|option1|option2|option3|option4|
3. the user entries must be captured in... (9 Replies)
I have tried searching the forum but i haven't found a solution for this.
I have a shell script that presents the users with menus. The menus branch out to sub menus. It is all hunky dory as long as i traverse forward. But if i am in a sub menu and return to the previous menu and choose any... (11 Replies)
I'm writing a shell script and have a problem with selection when I issue the command, is there a way to automatically choose a selection number one after a selection menue appear
Command
1-choice
2- choice
3-choice
Thanks
Sara (3 Replies)
I have a menu option which will look as follows
Select a menu option
1.change password
2.login as root user
3.show system version
4.quit
Select> 1
please enter the new password: unix
reenter the new password: unix
press any key to enter
(then displays again the menu options to enter the... (4 Replies)
Hi Friends,
I have a menu based tool which requires input/option to proceed further. How to make a shell script ?
eg: menu looks like
Get_data.sh
to continue (y/n) :
Here I need to key in "y" to proceed.
I want to prepare a script which should consider option y. (5 Replies)
Discussion started by: suresh3566
5 Replies
LEARN ABOUT ULTRIX
exec
exec(1) User Commands exec(1)NAME
exec, eval, source - shell built-in functions to execute other commands
SYNOPSIS
sh
exec [argument...]
eval [argument...]
csh
exec command
eval argument...
source [-h] name
ksh
*exec [arg...]
*eval [arg...]
DESCRIPTION
sh
The exec command specified by the arguments is executed in place of this shell without creating a new process. Input/output arguments may
appear and, if no other arguments are given, cause the shell input/output to be modified.
The arguments to the eval built-in are read as input to the shell and the resulting command(s) executed.
csh
exec executes command in place of the current shell, which terminates.
eval reads its arguments as input to the shell and executes the resulting command(s). This is usually used to execute commands generated as
the result of command or variable substitution.
source reads commands from name. source commands may be nested, but if they are nested too deeply the shell may run out of file descrip-
tors. An error in a sourced file at any level terminates all nested source commands.
-h Place commands from the file name on the history list without executing them.
ksh
With the exec built-in, if arg is given, the command specified by the arguments is executed in place of this shell without creating a new
process. Input/output arguments may appear and affect the current process. If no arguments are given the effect of this command is to mod-
ify file descriptors as prescribed by the input/output redirection list. In this case, any file descriptor numbers greater than 2 that are
opened with this mechanism are closed when invoking another program.
The arguments to eval are read as input to the shell and the resulting command(s) executed.
On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways:
1. Variable assignment lists preceding the command remain in effect when the command completes.
2. I/O redirections are processed after variable assignments.
3. Errors cause a script that contains them to abort.
4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a vari-
able assignment. This means that tilde substitution is performed after the = sign and word splitting and file name generation are not
performed.
EXIT STATUS
For ksh:
If command is not found, the exit status is 127. If command is found, but is not an executable utility, the exit status is 126. If a redi-
rection error occurs, the shell exits with a value in the range 1-125. Otherwise, exec returns a zero exit status.
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsu |
+-----------------------------+-----------------------------+
SEE ALSO csh(1), ksh(1), sh(1), attributes(5)SunOS 5.10 17 Jul 2002 exec(1)