Skip to main content

While I have 40 years experience with standard MVS I still have problems understanding some of the language used in USS.

The GIT release notes has a “Sample shell code (for .bashrc)” , the first line says

 # This must be sourced, not run

Can someone explain to me what “sourced” means ?

Regards,
Gary

While I have 40 years experience with standard MVS I still have problems understanding some of the language used in USS.

The GIT release notes has a “Sample shell code (for .bashrc)” , the first line says

 # This must be sourced, not run

Can someone explain to me what “sourced” means ?

Regards,
Gary

Hello Gary!
In this case it means that you’re not supposed to run .bashrc script as
$ ./.bashrc
but instead run it like
$ source .bashrc
Here is a good explanation of the difference here

With respect, Dan.


While I have 40 years experience with standard MVS I still have problems understanding some of the language used in USS.

The GIT release notes has a “Sample shell code (for .bashrc)” , the first line says

 # This must be sourced, not run

Can someone explain to me what “sourced” means ?

Regards,
Gary

Thanks Dan. The explanation is excellent.


While I have 40 years experience with standard MVS I still have problems understanding some of the language used in USS.

The GIT release notes has a “Sample shell code (for .bashrc)” , the first line says

 # This must be sourced, not run

Can someone explain to me what “sourced” means ?

Regards,
Gary

Does “source” work for everyone? It does not work for me? I have to use the “dot” version. Specifically, if I do the following:
source /u/dvfjs/swift-4/etc/profile
I get an error: source: FSUM7351 not found. On the other hand, this works:
. /u/dvfjs/swift-4/etc/profile

I just realized that bash is not my default shell, so I guess the default shell (whatever that is) does not support “source”. Can a user change their default shell?


Does “source” work for everyone? It does not work for me? I have to use the “dot” version. Specifically, if I do the following:
source /u/dvfjs/swift-4/etc/profile
I get an error: source: FSUM7351 not found. On the other hand, this works:
. /u/dvfjs/swift-4/etc/profile

I just realized that bash is not my default shell, so I guess the default shell (whatever that is) does not support “source”. Can a user change their default shell?

Hi,

You can change your login shell with this tso command:

tsocmd alu your_login omvs(program(’/path/to/bash/bin/bash’))


Hi,

You can change your login shell with this tso command:

tsocmd alu your_login omvs(program(’/path/to/bash/bin/bash’))

Thanks for the info. As an application developer I do not have ALTUSER access, even for myself. Oh well!


Does “source” work for everyone? It does not work for me? I have to use the “dot” version. Specifically, if I do the following:
source /u/dvfjs/swift-4/etc/profile
I get an error: source: FSUM7351 not found. On the other hand, this works:
. /u/dvfjs/swift-4/etc/profile

I just realized that bash is not my default shell, so I guess the default shell (whatever that is) does not support “source”. Can a user change their default shell?

bash understands both, source and . (dot). /bin/sh understands . (dot) only, and /bin/tcsh understands source only.


Thanks for the info. As an application developer I do not have ALTUSER access, even for myself. Oh well!

I am late to the game, but if you want to use bash as your login shell, add the following line to the end of your startup shell script (mine is .profile).

exec bash

This has been working well for me.