PDA

View Full Version : Linux command line:Bash usage of source



todd987345
10th June 2010, 05:00 PM
hello,

I am familiar with Red Hat Linux, and I have recently started to use Fedora.

I am trying to use the source command to set CNS (crystallography and NMR systems), but I can not use the source command nor can I get source command help on the command line.

Does the source command work for Fedora?

forkbomb
10th June 2010, 05:43 PM
but I can not use the source command
What do you mean by this? Do you get some sort of error?


nor can I get source command help on the command line.
What do you mean by this? man pages? 'man source' should actually redirect you to the bash man page.


Does the source command work for Fedora?
Works here. source is a bash built-in. Are you sure bash is your login shell? Have you seen something that has convinced you that it's not working?

todd987345
10th June 2010, 07:19 PM
When I input the command in the command line, such as "source --help", I don't get any help options for the source command.

I have in the past usually have to enter the source command manually in the command prompt window. As I have done in the past when running Red Hat linux.

What do you mean that source is built into linux?

I have installation instructions for CNS, and within these instructions state that I have to source CNS before use.

forkbomb
10th June 2010, 08:28 PM
When I input the command in the command line, such as "source --help", I don't get any help options for the source command.
And? see
man bashand/or
man builtin



I have in the past usually have to enter the source command manually in the command prompt window. As I have done in the past when running Red Hat linux.
Uhh... okay.

But that doesn't mean that source is busted on Fedora.

What do you mean that source is built into linux?
I didn't say that.

I said "source" is a bash built-in. bash is a shell that just so happens to be the default CLI shell for Fedora. bash, the shell, has a number of commands that are considered to be shell builtins.


Read and execute commands from the filename argument in the current shell context.
http://www.gnu.org/software/bash/manual/html_node/Bash-Builtins.html
http://www.gnu.org/software/bash/manual/html_node/Bourne-Shell-Builtins.html#Bourne-Shell-Builtins


I have installation instructions for CNS, and within these instructions state that I have to source CNS before use.What's the exact command or series of commands it tells you to run? Does it tell you what file to source? If that's all the instructions say, that's vague. You may be better off contacting the software vendor if anything's unclear.

Bottom line is that unless we're thinking of different commands here, if you have bash installed (and bash is the default shell on Fedora and other Red Hat-like operating systems), source is almost certainly working. Check to make sure you're actually running bash (echo $SHELL)

Until you mention what you're actually trying to do with the command or say what the instructions are telling you, all anybody can really offer is guesswork.