That is a terrible idea. Never put relative paths inside your PATH. At best it's a security risk, at worst, it will cause things to actually fail. The shell tries to cache what programs are available when it runs, but this will not work right when things in PATH are relative. Everything inside PATH must be an absolute path!
Second, there's a reason the current directory is not included for running executables. It's not "missing", it's on purpose. It's to prevent people from dumping malign files into a folder you frequent and having you accidentally run them.
Ok, I kinda get that it might be about having executables in permissions protected directories, but if all you need to do is use the absolute pathname, it doesn't seem like much security. Especially if it's just a dot-slash. Of course, it forces you to make sure executing it is what you want to do.
So you guys think that's what the deal is?
---------- Post updated at 11:42 PM ---------- Previous update was at 11:41 PM ----------
Quote:
Originally Posted by bipinajith
I think the reason is because current directory is missing in the PATH variable value. Add current directory and retry:-
I have no need to put these practice scripts I'm doing in my PATH. It's not an issue - just something I was wondering about. If I ever write something useful, I'll stick it in /usr/local/bin
I should have mentioned - I'm running Mac OS, bash shell.
Last edited by sudon't; 11-29-2012 at 12:54 AM..
Reason: mention OS
How can I get the results of a find back without the pathname
for example if i do
find ../../ -name \*.sql
i dont want to see
directory/directory/filename.sql
I only want to see filename.sql (3 Replies)
With C Shell you can get the root, head, tail and extension of a pathname by using pathname variable modifiers.
Example Script:
#! /bin/csh
set pathvar=/home/WSJ091305.txt
echo $pathvar:r
echo $pathvar:h
echo $pathvar:t
echo $pathvar:e
The result of executing this script is:
... (7 Replies)
Hi All,
We use tomcat web server and it will get terminated with below error:
connection to localhost:10.0 host broken (explicit kill or server shutdown)
Please let me know how to fix this error. (5 Replies)
Hi
Could someone help me?
I'm not sure how to find the full pathname of a directory.
I just want to be able to specify a directory.
e.g
directory1/directory2/directory3/directory4/directory5
I want to be able to put in "directory5"
and then i want a return of the full address.
... (3 Replies)
I'm running IPF on solaris 10
bash-3.00# ipf -V #display ipf version
ipf: IP Filter: v4.1.9 (592)
Kernel: IP Filter: v4.1.9
Running: yes
Log Flags: 0 = none set
Default: pass all, Logging: available
Active list: 1
Feature mask: 0x107
with the following rules
bash-3.00# ipfstat -o -i... (0 Replies)
I want to run applet on AIX 6 machine.
I already have setup $DISPLAY variable for putty session by selecting X11 option.
I got below error for any X related commands (xclock, X, applet viewer )
X connection to localhost:10.0 broken (explicit kill or server shutdown). Please can anyone... (0 Replies)
I have executed the below perl script for copying the file from one server to another server using scp.
#!/usr/bin/perl -w
use Net::SCP::Expect;
use strict;
$server= "x.x.x.x";
my $source = "/mypath/mypath";
my $destination = "/home/";
print "Login...Starting scp...";
$user="admin";... (1 Reply)
Add explicit route to 10.128.255.41/32 , gateway: 10.128.201.254
if not working, please try gateway through management port: 10.128.55.254
Just want to double confirm if this would be the correct command
#route add -net 10.128.255.41/32 10.128.201.254
And if didnt work
#route add... (1 Reply)
Discussion started by: Thilagarajan
1 Replies
LEARN ABOUT XFREE86
filecap
FILECAP:(8) System Administration Utilities FILECAP:(8)NAME
filecap - a program to see capabilities
SYNOPSIS
filecap [ -a | -d | /dir | /dir/file [cap1 cap2 ...] ]
DESCRIPTION
filecap is a program that prints out a report of programs with file based capabilities. If a file is not in the report or there is no
report at all, no capabilities were found. For expedience, the default is to check only the directories in the PATH environmental variable.
If the -a command line option is given, then all directories will be checked. If a directory is passed, it will recursively check that
directory. If a path to a file is given, it will only check that file. If the path to the file includes capabilities, then they are written
to the file.
OPTIONS -a This tells the program to show all capabilities starting from the / directory. Normally the PATH environmental variable is used to
show you capabilities on files you are likely to execute.
-d This dumps all capabilities for reference.
EXAMPLES
To check file capabilities in $PATH:
filecap
To check file capabilities of whole system:
filecap -a
To check file capabilities recursively in a directory:
filecap /usr
To check file capabilities of a specific program:
filecap /bin/passwd
To list all possible capabilities:
filecap -d
To set a file capability on a specific program:
filecap /bin/ping net_raw net_admin
SEE ALSO pscap(8), netcap(8), capabilities(7).
AUTHOR
Steve Grubb
Red Hat March 2009 FILECAP:(8)