Thursday, June 12, 2008

What do you mean by Sourcing in Shell Scripting

Executing commands in current shell without opening a new shell to execute the commands.

eg:
vjsujay@linuxdemon$source sample.sh
or
vjsujay@linuxdemon$. sample.sh #dot(.) should be separated by a space(s)

Two main objective of sourcing:
1.) Exporting the common variables file in the current shell, when required.
2.) Exporting the reusable functions file in the current shell, when required.

No comments: