0

so I'm very new to linux scripting. In .profile I just want to load a module and then print out a message to remind me it loaded, but I'm encountering an error when I go about it in that order.

It works fine when I have:

echo "loading oracle/muscle..." module load oracle/muscle

(that is literally all that i have in .profile)

I'd prefer to have:

module load oracle/muscle echo "oracle/muscle loaded"

But when I do this and log in, I get an error back saying, "Unable to locate a modulefile for oracle/muscle". I suppose its some kind of syntax error but I couldn't find anything that really described this kind of error. Any help would be much appreciated. Thanks!!

Austin Day
  • 141
  • 1
  • 8

2 Answers2

0

Are you sure that part is working:

echo "loading oracle/muscle..." module load oracle/muscle

??

I think You should separate command "echo" from "module". I tested your config (Debian 6, I've used "modprobe" instead "module load"):

root@ian:~# lsmod | grep loop
root@ian:~#
root@ian:~# grep modprobe .profile
echo "Loading loop" modprobe loop
root@ian:~# source .profile
Loading loop modprobe loop
root@ian:~# lsmod | grep loop
root@ian:~#

Above module loop has not been loaded. IMHO it should looks like this:

root@ian:~# grep modprobe .profile
echo "Loading loop"; modprobe loop
root@ian:~# lsmod | grep loop
root@ian:~# source .profile
Loading loop
root@ian:~# lsmod | grep loop
loop                    9745  0
root@ian:~#

What's more it would be better to print "echo" when module ended successfully:

module load oracle/muscle && echo "Module loaded"

Kindly please test and let us know about result

  • Sorry I've taken so long to respond.... I guess what I'm looking for is how linux scripts work on a basic level. For instance my initial script: echo "loading..." module load oracle/muscle is really broken up into two lines (which works) but doesn't work when on the same line. then you're fix (with the &&) works on one line but not on two – Austin Day Feb 27 '15 at 06:10
0

The "Unable to locate a modulefile for oracle/muscle" error you got is because module is not able to find a modulefile called oracle/muscle in the modulepaths currently enables.

You should enable the modulepath containing the oracle/muscle modulefile prior to load it with the use sub-command:

module use /path/to/modulefiles
module load oracle/muscle