0

I'm trying to compile a library and his dependencies (lots of dependencies), but the system that I'm using didn't have the usual directory structure. I'm searching for a method to "redirect" all the scripts callings to, for example, /bin/sh to /foo/bar/sh.

Is something like this possible?

EDIT:

I forgot to tell that / is read-only, so i can't make a /bin directory containing symbolic links pointing to the actual bin directory

Michele
  • 101
  • 6

2 Answers2

0

You can use symbolic links.

ln -s /foo/bar/sh /bin/sh

First, you'll have to remove the original /bin/sh. But make sure you don't use the /bin/sh at the moment you launch the rm (or mv), otherwise you may get yourself locked. The best change your shell to /foo/bar/sh first and try to login while you still have original shell running so you can fix possible issues.

Jaroslav Kucera
  • 1,545
  • 11
  • 18
0

Just use the $PATH variable.

export PATH=/foo/bar:$PATH <command>

In this way you will load binaries before from /foo/bar than /bin.

phra
  • 41
  • 8