0

There is a binary in my home directory: "foo"
My PATH variable doesn't contains my home dir.
I cannot change my PATH varible, since it's read-only

Question: How can I execute this binary without using the following:

./foo
. ./foo
10
  • 5
    What problem are you trying to solve? Why not use one of those, or ~/foo? – mattdm May 6 '15 at 19:35
  • I cannot have any "/" in my commands – LoukiosValentine79 May 6 '15 at 19:38
  • Can you explain why that is? bash foo doesn't have a slash in it after all... – Jan May 6 '15 at 19:47
  • 1
    Is the actual question "how can I run an arbitrary executable in a restricted shell"? – Mark Plotnick May 6 '15 at 19:54
  • 1
    Or is the question "what's the difference between the three ways of running programs"? – lcd047 May 6 '15 at 19:55
1

Try this:

create a parse.sh file with content:

#!/bin/bash
export PATH=$PATH:./
foo

execute with bash --noprofile --norc parse.sh

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.