Loading ...
Sorry, an error occurred while loading the content.

7794Re: Global profile for ash

Expand Messages
  • jl0242
    Apr 24, 2009
    • 0 Attachment
      Okay, now I'm really confused. Looking at this output:

      http://pastebin.com/f5c759f53

      It looks like the path is set correctly. Ash seems to be using a version of 'find' that's not from /urs/bin *or* /opt/bin. Line 10 shows output from the version of 'find' that ash is using, line 15 shows the output from the version in /usr/bin, and line 29 shows the output from the version in /opt/bin (the findutils version, the version that I actually want).

      Since the steps clearly show that /opt/bin is at the front of the path (don't know where this is being set from, but I suppose that doesn't matter) - where on earth is ash getting getting this 3rd copy of find??

      Sorry, I realise now this is far more linux/shell related than slug related :S


      --- In nslu2-general@yahoogroups.com, "jl0242" <japher@...> wrote:
      >
      > Hi,
      >
      > I'm having some path problems when running scripts on Unslung 6.10. I was running Unslung 6.8 until I recently rebuilt my slug, and I somehow had this set correctly before the rebuild!
      >
      > I want my scripts to use the bins in /opt/bin, rather than /usr/bin. /us/bin seems to contain the cutdown BusyBox v1.3.1 apps, and /opt/bin contains the full apps (e.g. installed via findutils, coreutils, etc). When I log in via ssh (into bash), my path seems to be set correctly (it's not set in my .bashrc, but I assume it's set in the global profile for bash). However, when I run a script that contains the header line #!/bin/sh, the context in which the script executes doesn't seem to have /opt/bin at the front of the path (it uses apps in /usr/bin). This is causing my scripts to fail.
      >
      > As a quick demonstration, the below shows what happens when I run the find command (using an option that only the findutils version supports) in both bash and ash:
      >
      > ~$ find -maxdepth 1
      > .
      > ./.ssh
      > ./.bash_history
      > ./.bash_profile
      > ./.bashrc
      > ./.inputrc
      > ~$ sh
      >
      >
      > BusyBox v1.3.1 (2007-12-29 03:38:35 UTC) Built-in shell (ash)
      > Enter 'help' for a list of built-in commands.
      >
      > \w$ find -maxdepth 1
      > BusyBox v1.3.1 (2007-12-29 03:38:35 UTC) multi-call binary
      >
      > No help available.
      >
      > \w$ exit
      >
      > Is there a global profile I can set for ash? I've looked in /etc/profile, but the path being set looks correct:
      >
      > PATH=/opt/sbin:/opt/bin:/sbin:/bin:/usr/sbin:/usr/bin
      >
      > (/opt/bin is before /usr/bin)
      >
      > So I can only assume that /etc/profile is not going to help me.
      >
      > Do I have to do this via a diversion script?
      >
      > Cheers,
      >
      > joe
      >
    • Show all 9 messages in this topic