General :: Why Is It Bad To Add '.' To PATH?
Aug 26, 2010
I've read one explanation saying it can allow malicious executables that are in the cwd to run in place of similarly named built-ins and core utilities.For something to wreak true havoc, wouldn't this only apply to root? And in any case, if '.' were appended to PATH instead of prepended, shouldn't that circumvent this "replacement" attack, since PATH's directories are scanned in order? (Aren't they scanned in order?)Are there any other issues besides this one?
View 4 Replies
ADVERTISEMENT
Jan 16, 2011
I found the following function in /etc/profile file.
[Code]...
1. I dont undestand what "if ! echo $PATH | /bin/grep -qE "(^|:)$1($|:)"" this if statement actually comapres??
2. Also what is the difference between PATH=$PATH:$1 & PATH=$1:$PATH
View 14 Replies
View Related
Oct 8, 2010
I use this command:
Code:
find ./ -atime +360
to figure out the files that haven't been accessed since 360 days. The command above will return results like this:
Code:
/uploads/2010/02/some-file-name.ext
/uploads/2009/08/another-file-name.ext
... etc
I'm taking here about tins of directories, thousands of files. I'm looking to find a command that makes me able to move the results above to another path, and to create that path once it doesn't exist like below:
Code:
mv /uploads/2010/02/some-file-name.ext /old-files/uploads/2010/02/some-file-name.ext
But I want the executed command to create this path
Code:
/old-files/uploads/2010/02/
If it doesn't exist.
View 6 Replies
View Related
Feb 21, 2011
I have a program that takes a relative path as input appends it to a some path string to get the actual path.
Now all I can input is the relative path. So if I want to go one level above my input will be ../mypath.
If I know the depth of the path used internally, I can use .. as many times to go to the root directory and then give the absolute path. But suppose I do not know the depth of the directory, can I construct a relative path string such that it considers it as a relative path. One way could be to have enough .. in the path string so that I can force an absolute path for some maximum depth of path.
Is there some path string syntax that I am not aware of but can achieve this?
View 2 Replies
View Related
Apr 26, 2011
Experimenting with shell variables, accidentally deleted the path variable how could I return to the original path value. What kinds of problems will I have if I don't have a path variable.
View 3 Replies
View Related
Sep 14, 2009
I have a path c:windowsackup I need this string to be changed into /windows/back/up I used the command -bash-3.00$ echo windackup | sed 's/\//g' but the output is windbackup
View 7 Replies
View Related
May 31, 2011
Current script:-
prefix=user@my-server:
find . -depth -type d -name .git -printf '%h�' | while read -d "" path ; do (
cd "$path" || exit $?
[code]....
How shall i go about changing the absolute path to relative path, so that /home/git/mirror/android/adb/ndk.git gets converted to /mirror/android/adb/ndk.git //echo <command> "$prefix$PWD.git" ?? - anything for relative path?
View 7 Replies
View Related
Jul 12, 2011
kernel 2.6.21.5, slackware 12.0
GNU bash 3.1.17
Code:
As you can see, /usr/local/bin is in the path. However, bash does not look for nasm in /usr/local/bin.
If I am root, things go well:
Code:
View 16 Replies
View Related
Jul 17, 2009
Java applet not loading image with relative path(e.g. images/1.jpg) but loads image with absolute path(i.e. from /root/user/images/1.jpg) . This is a problem when i want to host the applet on web server
View 2 Replies
View Related
Oct 21, 2010
how to add a path to PATH variable permanently so that it remains persisent even after closing shell and rebooting the system when i added a path, to variable it remained there as long as i didn't closed the shell. but when i reopened it ,changed were undone.
View 2 Replies
View Related
Apr 19, 2009
I am trying to figure out how i can add the path /usr/sbin/ into the $PATH variable. I want this to be used from the normal account. I am bored settinh this manualy each time my computer starts.
View 2 Replies
View Related
Jun 14, 2011
When I add some path in .bashrc by commenting out old path and adding new one like this:
#EXPORT HOME_PLAY=/home/gem/old_play
EXPORT HOME_PLAY=/home/gem/play
EXPORT PATH=$PATH:HOME_PLAY
After saving above changes, I enter the command: source ~/.bashrc Now if I do echo $PATH, the path shows both the old PLAY_HOME and new PLAY_HOME. This is really bad and messes up a lot of things in my project. This problem only goes away if I logout or reboot, a rather very long process. What is happening is that the old path is added to new path element and the old path includes the old path element you want to remove.
View 10 Replies
View Related
Aug 13, 2010
Does anyone know how to get the path with a inode number by C programming?
Or can I get the absolute path without giving a "path" but a inode number by C?
like this: get_path(unsigned inode);
not such this function: getcwd(".", xxx);
taowuwen@gmail.com
View 7 Replies
View Related
Nov 4, 2009
I'm using my Linux (SLES 10) server as a File Server at this point. I need to set File Permissions to nested folders differently to different groups. For example:
homesharedengineering* should be read only for groupA
homesharedengineeringadmin should be read & write for groupB Plus read only for groupA
homesharedengineeringautocad should be read & write for groupC Plus read only for groupA
I've been using Webmin and Putty to set permissions but Putty only allows me the Default Group, it won't allow me to set several groups on the same directory. Webmin seems to allow me to add multiple groups (Webmin --> Others --> File Manager --> Info & ACL tab will provide extended abilities) but when I add multiple groups, they don't seem to take effect? I'm wondering if my setup at the 'Share' level or at the hierarchy of my folder structure (unix based) needs to be set specifically?
View 1 Replies
View Related
Mar 23, 2010
running Windows 7 64bit with VMware Workstation 7.01-build 227600. I have some knowledge of Linux, I have installed f12 and have updated the system as of 03/22/2010. All updates completed successfully.
1) How do I install VMTools on the f12 (after mounting the CD/DVD tool package)
2) How do I update the gcc files it says are dependencies?
Here's what I get on installation:Before you can compile modules, you need to have the following installed...
make
gcc
kernel headers of the running kernel
and then I am prompted for this input from the install script:
Searching for GCC...
The path "" is not valid path to the gcc binary.
Would you like to change it? [yes]
and this is where I get stuck. How do I get around this or satisfy the requirements for the install?
View 5 Replies
View Related
Nov 11, 2010
I want a simple list of files in a directory that is not my current directory. I run ls /other/directory/*.txt and get:
/other/directory/file1.txt
/other/directory/file2.txt
I want:
file1.txt
file2.txt
How can I get the second list?
View 4 Replies
View Related
Jan 22, 2011
If I try "shutdown" as a normal user on Debian it give the "command not found" error. OK it's not in my PATH. But if I "sudo shutdown" it works. Somehow sudo seems to change my PATH.
Do the same in Slackware however and sudo makes no difference, I get "command not found" each time.
View 8 Replies
View Related
Jan 14, 2010
By mistake I have modified the PATH variable you know what a kind of mess it is.
Code:
echo $PATH
I just need to set the path variable again so I just need the format. Or can anybody come up with how to set the path variable.
View 6 Replies
View Related
Dec 15, 2010
What is a full path name?
View 6 Replies
View Related
Apr 12, 2011
I am trying to zip a directory but when I zip and unzip it, it contains the whole path of the variable "album". I would just like to zip the last folder in the path. Here is what I have now. I tried basename but that didn't seem to work, possible I just can't make it work right.
Code:
#!/bin/sh
album=/var/www/hfandt.com/artists/*/*
[code]...
View 14 Replies
View Related
Jul 29, 2011
I create a bash script and I assign a folder variable like:
#!/bin/bash
....
Myvariable_FOLDER_PATH=/PATH/TO/SPECIFIC/SUBFOLDER
is there any way to make another variable with just the specific SUBFOLDER
(?some command?)----> will make My_variable_subfolder = SUBFOLDER
so if I do
echo $Myvariable_FOLDER_PATH
i get: /PATH/TO/SPECIFIC/SUBFOLDER
and echo $My_variable_subfolder
i get: /SUBFOLDER
The tree and path names will change so I jjust want the last subfolder that I will access to access its files.
View 3 Replies
View Related
Feb 16, 2010
I added a path in my bash_profile so that I could use the executables in the directory (I thought). But it turned out some other directory has the same executables and the path had already been added by the previous user. Is there way to overwrite this path? I can't find where that old path was added.
View 10 Replies
View Related
Jun 7, 2010
GNU/linux kernel 2.6, slackware 12.0
Can ls display the whole path of a file? Suppose I have /media/cdrom1/*. So I want the output of ls to be
/media/cdrom1/file1
/media/cdrom2/file2
..................
/media/cdrom2/fileN
View 12 Replies
View Related
Feb 5, 2010
Let us assume I have a zip file called patch.zip, when I run unzip -l patch.zip I get the following output.
bin/a
bin/b
lib/c
To this zip file I want to add a new file, "Readme.txt" located at /path/to/Readme.txt in such a way that, when I re-run unzip -l patch.zip again I get something like this
bin/a
bin/b
lib/c
doc/Readme.txt
View 2 Replies
View Related
Apr 28, 2010
I'm using Ubuntu 9.10 (karmic). And, my ~/.pam_environment looks like the following.
PATH DEFAULT=${PATH}:~/Adobe/Reader9/bin:~/texlive/2009/bin/x86_64-linux
GIT_EDITOR DEFAULT=vim
MANPATH DEFAULT=${MANPATH}:~/texlive/2009/texmf/doc/man
INFOPATH DEFAULT=${INFOPATH}:~/texlive/2009/texmf/doc/info
But, echo $PATH returns me duplicated entries as the following.
/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games:~/Adobe/Reader9/bin:~/texlive/2009/bin/x86_64-linux:~/Adobe/Reader9/bin:~/texlive/2009/bin/x86_64-linux
I've tried replacing DEFAULT by OVERRIDE in my ~/.pam_environment file. But, that didn't help.
View 1 Replies
View Related
May 28, 2010
On Linux, I can access my joystick with the following path: /dev/input/js0. Is there a similar way I can access my joystick on Windows?
View 2 Replies
View Related
Dec 9, 2010
Is there an easy way to create all subdirectories of a path in linux ?
Something like
mkdir /a/b/c/d/e/f
executed in / should create directories a,b,c,d,e,f
View 2 Replies
View Related
May 1, 2011
I had a problem recently, where a perl script was consuming server resources. I found out it was a perl script by using "top". But it didn't give the path to the script. Nor did ps.Also, ps -ef showed that the process with that pid is /usr/bin/httpd (apache), so it must have been apache serving some perl page I suppose.Is it possible to get the path to currently running perl script, if I only know the process PID of the perl process that is running that script? If so, how? I don't need the path to the perl binary, I need the path to the perl script that binary is currently executing.
View 2 Replies
View Related
May 20, 2011
On Unix I can call certain programs from everywhere, like sort, pwd or my_custom_script.sh. How can I find out, where on the system my_custom_script.sh really resides?
View 2 Replies
View Related
Jun 10, 2011
I have the following files:
~/Dir1/file1.txt
~/Dir2/file2.txt
Then I use the following command:
cd ~ zip out.zip /Dir1/file1.txt /Dir2/file2.txt
In the out.zip i can see two directories (dir1 and dir2) but want only these two files (file1.txt and file2.txt) were in the root of out.zip! I thought the "-D" option is what I need, but it doesn't work
View 1 Replies
View Related