03-16-2020
Does your shell provide the select builtin? Which, in combination with the case ... esac construct, helps building menus in a simple way.
This User Gave Thanks to RudiC For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I need to get the user input and execute a particular script based on the input provided.
For E.g. When I execute the script say Test.sh it should prompt "For which country I need to execute the script? (US/India)"
Based on the input as US or India from the user the execution of... (8 Replies)
Discussion started by: yoursdavinder
8 Replies
2. Shell Programming and Scripting
I am using festival speech synthesis system and I would like to allow user input in a browser. This will be taken by a php page which is then supposed to pass the input text to a perl script. The perl script should pass this text to the festival engine by executing a unix command. this in turn... (2 Replies)
Discussion started by: wairimus
2 Replies
3. Shell Programming and Scripting
Hi,
I have a perl script which prints me the epoch value of a specific date and time given.Now I want to proceed to a next step ie i want to give the input at the time of execution.
I have to initialise the date and time values in the script before executing it.But now i want to give the date... (3 Replies)
Discussion started by: jyothi_wipro
3 Replies
4. Shell Programming and Scripting
Hello
I am trying to create a user input shell scipt. The objective is user should enter the circuit number and the input is saved in a log file. If the user does not enter anything then the question should prompt it until the circuit no. is entered.
Can any one please correct the code below.... (3 Replies)
Discussion started by: sureshcisco
3 Replies
5. Shell Programming and Scripting
Hi Jim,
I have following script,i which i need to take dynamic value .
script,
nawk -v v1=grep"INT_EUR" $propertifilename | cut -d"=" -F2` -F'~' '{if (NF-1 !=v1)
{print "Error in " $0 " at line number "NR" tilde count " N-1}}' $filename
In the above script i want to use INT_EUR as a variable... (2 Replies)
Discussion started by: Ganesh Khandare
2 Replies
6. Programming
Hi gurus,
I have a requirement where I need to remotely run a perl script as another user.
Running the script locally as the required user is fine, however I need to su with the script due to filesystem permission issues. I do not want to update permissions on the remote server due to security... (5 Replies)
Discussion started by: melias
5 Replies
7. Shell Programming and Scripting
i have a script which takes input from user, if user gives either Y/y then it should continue, else it should quit by displaying user cancelled.
#!/bin/sh
echo " Enter your choice to continue y/Y OR n/N to quit "
read A
if
then
echo " user requested to continue "
##some commands... (7 Replies)
Discussion started by: only4satish
7 Replies
8. Shell Programming and Scripting
#/bin/sh
echo "enter the user name"
read $username
echo "Enter new home directory"
read $newhd
usermod -d $newhd $username ;;
error while executing :
enter the user name
Rev
Enter new home directory:
/home/58745
usermod: option requires an argument -- 'd'
Try `usermod --help' or... (2 Replies)
Discussion started by: Revanth547
2 Replies
9. Shell Programming and Scripting
Using Linux (bash), I have two files which contain information about berries. Example:
file1.txt:
Blueberry blue 14
Raspberry red 12
Blackberry dark 4
file2.txt
Blackberry sour 4 3
Blueberry tasty 12 78
Strawberry yummy 33 88
I want to merge these two files into one. The desired... (5 Replies)
Discussion started by: Zooma
5 Replies
10. Shell Programming and Scripting
Hi everyone, I'm new here and just a beginner in linux scripting.
Just want to ask for help on this one.
I am trying to create a script that will accept user input (year-month and user/s).
I wanted to have the script to continue running, until the user inputs a DATE and name/s of user/s. ... (2 Replies)
Discussion started by: Helskadi
2 Replies
LEARN ABOUT CENTOS
stapdyn
STAPDYN(8) System Manager's Manual STAPDYN(8)
NAME
stapdyn - systemtap dyninst runtime
SYNOPSIS
stapdyn [ OPTIONS ] MODULE [ MODULE-OPTIONS ]
DESCRIPTION
The stapdyn program is the dyninst back-end of the Systemtap tool. It expects a shared library produced by the front-end stap tool, when
run with --dyninst.
Splitting the systemtap tool into a front-end and a back-end allows a user to compile a systemtap script on a development machine that has
the debugging information (need to compile the script) and then transfer the resulting shared objevct to a production machine that doesn't
have any development tools or debugging information installed.
Please refer to stappaths(7) for the version number, or run rpm -q systemtap (fedora/red hat) apt-get -v systemtap (ubuntu)
OPTIONS
The stapdyn program supports the following options. Any other option prints a list of supported options.
-v Verbose mode.
-V Print version number and exit.
-w Suppress warnings from the script.
-c CMD Command CMD will be run and the stapdyn program will exit when CMD does. The '_stp_target' variable will contain the pid for CMD.
-x PID The '_stp_target' variable will be set to PID.
-o FILE
Send output to FILE. If the module uses bulk mode, the output will be in percpu files FILE_x(FILE_cpux in background and bulk mode)
where 'x' is the cpu number. This supports strftime(3) formats for FILE.
-C WHEN
Control coloring of error messages. WHEN must be either "never", "always", or "auto" (i.e. enable only if at a terminal). If the op-
tion is missing, then "auto" is assumed. Colors can be modified using the SYSTEMTAP_COLORS environment variable. See the stap(1)
manual page for more information on syntax and behaviour.
var1=val
Sets the value of global variable var1 to val. Global variables contained within a script are treated as options and can be set from
the stapdyn command line.
ARGUMENTS
MODULE is either a module path or a module name. If it is a module name, the module will be looked for in the following directory (where
'VERSION' is the output of "uname -r"):
/lib/modules/VERSION/systemtap
$ stap --dyninst -p4 -m mod1 -e 'global var1="foo"; probe begin{printf("%s
", var1); exit()}'
Running this with an additional module argument:
$ stapdyn mod1.so var1="HelloWorld"
HelloWorld
Spaces and exclamation marks currently cannot be passed into global variables this way.
EXAMPLES
See the stapex(3stap) manual page for a collection of sample scripts.
Here is a very basic example of how to use stapdyn. First, use stap to compile a script. The stap program will report the pathname to the
resulting module.
$ stap --dyninst -p4 -e 'probe begin { printf("Hello World!
"); exit() }'
/home/user/.systemtap/cache/85/stap_8553d83f78c_265.so
Run stapdyn with the pathname to the module as an argument.
$ stapdyn /home/user/.systemtap/cache/85/stap_8553d83f78c_265.so
Hello World!
SAFETY AND SECURITY
Systemtap, in DynInst mode, is a developer tool, and runs completely unprivileged. The Linux kernel will only permit one's own processes
to be accessed, which is enforced by the ptrace(2) system call. See the stap(1) manual page for additional information on safety and secu-
rity.
SEE ALSO
stap(1), stapprobes(3stap), stap-server(8), staprun(8), stapex(3stap)
BUGS
Use the Bugzilla link of the project web page or our mailing list. http://sourceware.org/systemtap/, <systemtap@sourceware.org>.
STAPDYN(8)