You have /usr/sbin in your PATH setting twice. Having any directory in PATH more than once will slow down access to any utilities found in any directory after the second occurrence of that directory.
Unless you have some utility that appears in more than one of the directories in PATH, you want the directory that contains the most frequently used utilities first in your PATH and the directory containing the utilities that are the least frequently used last in your PATH. Under usual circumstances, you'll want to put /usr/bin first in PATH (and get rid of one of the /usr/sbin entries and one of the /root/bin entries) like:
Given the naming conventions used on the directories in your PATH, is there also a /root/sbin directory containing utilities that you sometimes want to find? And, as Jim suggested, if your system has /bin and /usr/bin as distinct directories, be sure that both of them are included in PATH.
This User Gave Thanks to Don Cragun For This Post:
Hello all,
i've written a small piece of code that will read commands from standard input and executes the commands.
Its working fine and is execting the commands well. Accepting arguments too. e.g
#mkdir <name of the directory>
The problem is that its not letting me change the directory i.e... (4 Replies)
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Hi @all
I have got the following problem:
I want my Master-Script to execute 2 Sub-scripts at the same time.
How can i realize that?
Thx for your help
Greez Roger (2 Replies)
Hello All. I suspect that this will be a clear noob question, but I haven't been able to figure it out using the usual methods, so I turn to you.
I've written a script to create input files for the quantum chemistry program NWCHEM. Generally you create an input file and then execute it by... (12 Replies)
I am writng a script in which there is an installation file.The installer runs good. But after the installer command there are some files and commands which are based on those installed files. Now problem is the commands get executed before the installer is totally installed. So is there any... (5 Replies)
Alright so i got this script genpipe:
echo "$*" |sh genscript file
vi file << 'HERE'
:%s/^/echo /g
:%s/ $//g
:%s/ /&\| xargs \.\/plus /g
:wq
HERE
cat file
Which generates output like echo 1 | xargs ./plus 2 | xargs ./plus 3 and so on
Now i got the next script multiplus, who should... (3 Replies)
I would like to execute multipe commands in a shell script. Please provide the commands for the below scenario:
Execute command1
if command1 is succesfull, then execute command2, command3,command4 in parallel
if command2, command3,command4 are success then run command 5 (3 Replies)
Hi ,
Is there any script to copy a files (weblogic bianary + silent.xml ) from one server (linux) to another servers and then execute the copy file.
We want to copy a file on multiple servers and run the installation.
Thanks (1 Reply)
I need to copy python script file to around 100 servers using expect script.
1. Copy script to my user home first(/home/myhome) on each remote server
2. change permissions on copied file to 766.
3. sudo to appuser1 account on remote server. copy script file from my user home to /usr/bin/... (1 Reply)
Hello,
What is its mean? Could you please help me?
Best regards,
root@nimserver:/> nimadm -j nimadmvg -c dev4 -s spot1 -l lpp_source1 -d "hdisk7" -Y
Initializing the NIM master.
Initializing NIM client dev4.
0042-006 c_rsh: (exec_nimsh_cmd) exec_cmd Error 0
poll: setup failure... (2 Replies)
Discussion started by: getrue
2 Replies
LEARN ABOUT FREEBSD
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/libexec/sm.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'', ``/home/server/mydir/bin/vacation'', and ``vacation''
all actually forward to ``/usr/libexec/sm.bin/vacation''.
System administrators should be conservative about populating the sm.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 sm.bin direc-
tory. Note that this does not restrict the use of shell or perl scripts in the sm.bin directory (using the ``#!'' syntax); it simply dis-
allows 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/libexec/sm.bin'').
FILES
/usr/adm/sm.bin - default directory for restricted programs on most OSs
/var/adm/sm.bin - directory for restricted programs on HP UX and Solaris
/usr/libexec/sm.bin - directory for restricted programs on FreeBSD (>= 3.3) and DragonFly BSD
SEE ALSO sendmail(8)
$Date: 2013-11-22 20:52:00 $ SMRSH(8)