1. What language is that? I want to read up on it.
2. What would be the general form of any unix command?
3. What would the unix command to run this with the arguments look like?
And thank your so much!
---------- Post updated 05-24-12 at 10:54 AM ---------- Previous update was 05-23-12 at 07:38 PM ----------
does this look right?
Code:
OPT=0
OP=0
while [ "$#" -gt 0 ]
do
case "$1" in
-cfg) cfg_file=$2; shift ;;
-dir) file_name=$2; shift ;;
-run) run_num=$2; shift ;;
-mask) OPT=1 ;;
-root) OP=1 ;;
*) break ;;
esac
shift
done
if [ -z "$cfg_file" ]
then
echo "No config file given" >&2
exit 1
fi
if [ -z "$file_name" ]
then
echo "No file name given" >&2
exit 1
fi
if [ -z "$run_num" ]
then
echo "No run number given" >&2
exit 1
fi
if [ "$OPT" -eq 1 ]
then
../bin/takeData -l -dir $file_name -trimVcal 60 -mask
cd ../convert_to_tree/
cp $file_name/phCalibrationFitTan_C0.dat $file_name/phCalibrationFit60_C0.dat
cp $file_name/phCalibrationFit60_C0.dat ~/log/bt0500$run_num
cp ../convert_to_tree/config.dat_original ~/log/bt0500$run_num
./convert_to_tree -l -r $run_num
./pulseHeightMain $run_num
if [ "$OP" -eq 1 ]
then
cd ~/log/bt05r00$run_num
root -l
else
../bin/takeData -l -dir $file_name -trimVcal 60
cd ../convert_to_tree/
./Analyze.py --dir $file_name --cfg $cfg_file $run_num
if [ "$OP" -eq 1 ]
then
cd ~/log/bt0500$run_num
root -l
fi
I added another option to run the change directory and run root -l and I want to add a -h help option and print some stuff. I'm assuming I'd ad a -h) *something* ;;
Moderator's Comments:
Code tags for code, please.
Last edited by Corona688; 05-24-2012 at 01:17 PM..
Okee problems...!!
What is happening: Unix server with some programms, workstations are windows 2000, the workstations work good but when you start a programm on the Unix server the CPU of the workstations go to 100% usage resulting that the system gets very slow. The programm well its running so... (2 Replies)
I tried looking for the answer online and came up with only a few semi-answers as to why file and directory names are case sensitive in Unix. Right off the bat, I'll say this doesn't bother me. But I run into tons of Windows and OpenVMS admins in my day job who go batty when they have to deal... (3 Replies)
hi
i want run an unix application from a windows program/application.i am using SSH(command line version)to log on to a unix machine from windows. the application has to read a configuration file inorder to run. the configuration file .CFG is in bin in my home directory. but the application... (1 Reply)
Hi,
My local server is :/usr/abcd/
Remote server is :/Usr/host/test/
I want to send files from local unix directory(All files starting with O_999) to
remote host unix directory.
Can any body give me the Unix Shell script to do this.
One more doubt: Shall we need to change the file... (1 Reply)
Hi Experts,
I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers.
Could some body provide the inputs for this.
and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Dear All,
Can someone help to command or program to transfer the file from windows to Unix server and from one unix server to another Unix server in secure way.
I would request no samba client. (4 Replies)
Discussion started by: yadavricky
4 Replies
8. Post Here to Contact Site Administrators and Moderators
We work hard to make The UNIX and Linux Forums one of the best UNIX and Linux knowledge sources on the net. The site is certainly one of the top UNIX and Linux Q&A sites on the web. In order to provide certain members the best quality account services, you can now get some great extra features by... (2 Replies)
Discussion started by: Neo
2 Replies
LEARN ABOUT SUSE
smrsh
SMRSH(8) System Manager's Manual SMRSH(8)NAME
smrsh - restricted shell for sendmail
SYNOPSIS
smrsh -c command
DESCRIPTION
The smrsh program is intended as a replacement for sh for use in the ``prog'' mailer in sendmail(8) configuration files. It sharply limits
the commands that can be run using the ``|program'' syntax of sendmail in order to improve the over all security of your system. Briefly,
even if a ``bad guy'' can get sendmail to run a program without going through an alias or forward file, smrsh limits the set of programs
that he or she can execute.
Briefly, smrsh limits programs to be in a single directory, by default /usr/lib/sendmail.d/bin/ allowing the system administrator to choose
the set of acceptable commands, and to the shell builtin commands ``exec'', ``exit'', and ``echo''. It also rejects any commands with the
characters ``', `<', `>', `;', `$', `(', `)', `
' (carriage return), or `
' (newline) on the command line to prevent ``end run'' attacks.
It allows ``||'' and ``&&'' to enable commands like: ``"|exec /usr/local/bin/filter || exit 75"''
Initial pathnames on programs are stripped, so forwarding to ``/usr/bin/vacation'', ``/usr/bin/vacation'', ``/home/server/mydir/bin/vaca-
tion'', and ``vacation'' all actually forward to `/usr/lib/sendmail.d/bin/vacation''.
System administrators should be conservative about populating the /usr/lib/sendmail.d/bin/ directory. For example, a reasonable additions
is vacation(1), and the like. No matter how brow-beaten you may be, never include any shell or shell-like program (such as perl(1)) in the
/usr/lib/sendmail.d/bin/ directory. Note that this does not restrict the use of shell or perl scripts in the /usr/lib/sendmail.d/bin/
directory (using the ``#!'' syntax); it simply disallows execution of arbitrary programs. Also, including mail filtering programs such as
procmail(1) is a very bad idea. procmail(1) allows users to run arbitrary programs in their procmailrc(5).
COMPILATION
Compilation should be trivial on most systems. You may need to use -DSMRSH_PATH="path" to adjust the default search path (defaults to
``/bin:/usr/bin'') and/or -DSMRSH_CMDDIR="dir" to change the default program directory (defaults to ``/usr/lib/sendmail.d/bin/'').
FILES
/usr/lib/sendmail.d/bin/ - default directory for restricted programs on SuSE Linux
SEE ALSO sendmail(8)
$Date: 2004/08/06 03:55:35 $ SMRSH(8)