something like this script below, it is written for MKS toolkit to be run on windows but it's based on ksh, it's pretty simple, used for uncompress zips and rars, menu based, simple menu though
Hi guys,
I am designing the rdbms in C/C++ on linux platform as my project.
Can any one help me in designing menu driven screen (like the pine ) which will print on screen as follows
1) create table
2) add table
............. etc
with arrow keys for... (2 Replies)
I need to have a script that can do an automated IPL function (how to reboot the box). I think ‘reboot’ would do the trick.
However, how would I go about doing it, for example if the user states from a menu script that I would like to reboot now. The problem is when I do the ‘reboot’ command I... (6 Replies)
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..
am new to unix scrpiting..I need a Menu need to create using shell scrpting
eg:
Food items
ready
paid
if i press "f" need to add items for a file food items..
if i press "r" it need to move into ready and remove from food items
if i press "p" need to update a filed in... (1 Reply)
i'm confused what this means.
i was asked to design a menu or command line option driven script that reads out of a DB and displays info such as
read_data.pl -u <user> -e <event>
which would print commands run by <user>with the <event> in the db.
any suggestions? i've been using... (2 Replies)
Hi, I was wondering if someone could help me write a shell script in Linux that backsup/restores data to anywhere I choose but it needs to be menu driven?
Thanks, I'm new to Linux/Unix but liking it so far...just hoping to get to grips with the scripts! :) (7 Replies)
I'm a beginner at scripting and have been putting this script together over the past week. It's no where as polish as it could be. Any tips/suggestions on improving this script would be appreciate it. Every week, my team develops WAR files in tomcat on our test environment and moves them to our... (4 Replies)
My employers would like me to selectively run one of several different (already-existing) Korn Shell menu-driven scripts out of the user's .profile file, depending on some yet-to-be-specified user critieria.
I've never done this kind of thing, but I have the existing scripts (among other... (5 Replies)
I need to write a shell script that allows some system-administration tasks to be preformed automatically from a menu-driven interface. Automate the following tasks:
• Copy directory tree
• Delete files or directories
• Output Information
But I don't understand the question. What is a "menu... (2 Replies)
Hi Team ,
I wrote a shell script for adding and subtracting two numbers am getting error could some one please help to fix it
script:
echo "Enter 1 to add:"
echo "Enter 2 to sub:"
echo "Enter 3 for both addition and subtraction :"
read ans;
case "$ans" in
1)... (4 Replies)
Discussion started by: knz
4 Replies
LEARN ABOUT DEBIAN
hexec
hexec(1)hexec(1)NAME
hexec - a process execution hooking tool
SYNOPSIS
hexec <OPTIONS> [expr] [cmd] [args...]
DESCRIPTION
hexec is a tool to hook into process exececution calls (exec family of syscalls). You can define an expression that is executed against any
hooked exec call. This expression may also contain a replacement exec call.
OPTIONS SUMMARY
Here is a summary of the options to hexec.
--help | -h Print a options/expr summary page
--version | -v Print hexec version
--log-out | -lo set output file for error and -print output
OPTIONS -h Print a options/expr summary page
--help Print a options/expr summary page
-lo Set the output file for error and -print output. This can be required if writing to stderr could cause malfunction because some
processes read from stderr and expect a well defined output.
EXPRESSIONS
The expression is executed against all process execution calls. If the expression returns true, the original call is skipped.
<expr> -and <expr>
<expr> -a <expr>
<expr> <expr>
Returns true if both expressions return true. If the left returns false, the right expression is never executed.
<expr> -or <expr>
<expr> -o <expr>
Returns true if one of both expressions returns true. If the left returns true, the right expression is never executed.
-path <pattern>
Returns true if the path of the executable matches <pattern>. <pattern> is a bash compatible wild card pattern.
-ipath <pattern>
Same as -path, but case insensitive.
-name <pattern>
Returns true if the base name of the executable matches <pattern>. <pattern> is a bash compatible wild card pattern.
-iname <pattern>
Same as -name, but case insensitive.
-contains <str>
Returns true if the path of the executable containes the string <str>.
-icontains <str>
Same as -contains, but case insensitive.
-print Print all arguments to the called process. Returns always true.
-exec <cmd> [args...] ;
Executes <cmd> with [args...] as arguments. This expression must be terminated with a semicolon. You can use argument placeholders
in <cmd> and [args...] (see below). This expression always returns true.
NOTE: Please be aware that you may need to escape or quote the terminating semicolon to not confuse your shell.
-sh <script>
Interprets <script> as a shell script by invoking /bin/sh with the arguments -c '<script>'. You can use argument placeholders inside
<script>. Please note that -sh only expects a single argument and not a variable list of arguments (as -exec does). Using -sh is the
same as using -exec sh -c <script>.
PLACEHOLDERS FOR -exec EXPRESSION
Every -exec expression can use placeholders in the argument list to obtain information from the original exec call. Each placeholder starts
with { and ends with }. Use { if you want to use a { in your argument list. The placeholders are replaced when the -exec expression is
evaluated.
Placeholder types:
{n} Will be replaced with the number of arguments in the original call.
{<idx>}
Will be replaced with the original argument at index <idx>. Example: {1} would give the first argument. You can prepend <idx> with
placeholder flags.
{} Will be replaced with all arguments from the original call. Each argument is seperated with a space. You can use placeholder flags.
NOTE: The executable name is also considered as argument. This means that a call like "echo test" will result in two arguments, "echo" and
"test".
PLACEHOLDER FLAGS
s Every argument is inserted as single argument instead of concatenating all arguments.
Consider the arguments 'a', 'b' and 'c'. Without s, -exec {} ; would result in -exec 'a b c' ;, which in many cases is not what
you want. -exec {s} ; howewer would result in -exec 'a' 'b' 'c' ;.
q Quote every single argument.
e Escape all non alpha-numeric characters. This flag is very useful when using a "sh -c <...>" in the -exec expression.
Examples
-exec echo {} ; with the call 'a' 'b' 'c'
results in: 'echo' 'a b c'
-exec echo {q} ; with the call 'a' 'b' 'c'
results in: 'echo' 'a' 'b' 'c'
-exec sh -c 'echo {}; {}' ; with the call 'sh' '-c' 'gcc d.c >> log.txt'
results in: 'sh' '-c' 'echo sh -c gcc d.c >> log.txt; sh -c gcc d.c >> log.txt'
Please note that this will not do what you may expect, as the >> is handled wrong in this case.
-exec sh -c 'echo {e}; {}' ; with the call 'sh' '-c' 'gcc d.c >> log.txt'
results in: 'sh' '-c' 'echo sh -c gcc d.c >> log.txt; sh -c gcc d.c >> log.txt'
CHANGES TO PROCESSES
hexec will add some environment variables to the hooked processes. These are (may not be complete):
LD_PRELOAD
hexec adds libhexec-hook.so to the list of preloaded libraries.
HEXEC_EXPR_SHM
Contains the name of the internal shared memory object.
HEXEC_LOG_FD
Contains the file descriptor for error and -print output.
Please do never modify these environment variables. Also take care when you use these variables, because the name and content of the vari-
ables may change in the future.
EXAMPLES
hexec -name 'gcc' -exec ccache {s} ; make
Calls make, which will then call gcc several times. The executable name of each hooked process execution is tested against the file
pattern "gcc" and "ccache {s}" is called each time a match is found. '{s}' will be replaced with the original (the hooked) call. In
this example, a call to "gcc -o test.o test.c" would be replaced with "ccache gcc -o test.o test.c"
HOW IT WORKS
TODO
BUGS
I'm sure there are alot...it's still beta :)
AUTHOR
hexec was written by Alexander Block http://blocksoftware.net/
If you wish to report a problem or make a suggestion then please email ablock@blocksoftware.net
hexec is released under the GNU General Public License version 2 or later. Please see the file COPYING for license details.
November 2008 hexec(1)