July 12, 20187 yr I'm trying to use find and run a execdir on .rar files for mass unpacking but i'm getting the error that . is in the $path. Should'nt that be removed? "find: The current directory is included in the PATH environment variable, which is insecure in combination with the -execdir action of find. Please remove the current directory from your $PATH (that is, remove "." or leading or trailing colons)" https://askubuntu.com/questions/621132/why-using-the-execdir-action-is-insecure-for-directory-which-is-in-the-path Edited July 12, 20187 yr by Tuumke
November 5, 20196 yr Sorry to resurrect an old thread. I'm currently running into the same issue and wondering whether you solved it. I'm trying to run ' find /mnt/user/downloads/ -name '*.rar' -execdir unrar e "{}" \; ' Edited November 5, 20196 yr by Toml
January 31, 20224 yr Sorry to resurrect an old thread... but to anyone coming across this problem in future, here is an easy solve applying a little beginner linux knowledge; # Take a backup of $PATH to restore later # Note: This will only keep the variable alive for the current session! $ PATH_TEMP=$PATH # ... just to make sure the $PATH_TEMP variable has been stored $ echo $PATH_TEMP .:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin # Print the current $PATH so we can extract all paths except the current directory, so we can override it $ echo $PATH .:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin #-^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ # Copy everything BUT the first current directory marker (.) and break character (:) # Next, export the modified $PATH to override it for the current session using the string you copied above $ export PATH=/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin # ... just to make sure the $PATH variable change has been stored $ echo $PATH /usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin # --- # ... now you can run the find command! # --- # To restore the session $PATH either close your current terminal session and start a new one, or to manually restore # the current session, lets load $PATH back from the $PATH_TEMP variable set earlier $ export PATH=$PATH_TEMP # ... verify everything is back to normal. Looking good! $ echo $PATH .:/usr/local/sbin:/usr/sbin:/sbin:/usr/local/bin:/usr/bin:/bin Edited January 31, 20224 yr by unraidyn
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.