If we create shell functions through a script itself, can we use the same functions in command line also..
for example:
$ cat a.sh
##### Functions
function system_info
{
}
function show_uptime
{
}
function drive_space
{
}
function home_space
{
}
$
then I executed this script and i want to use these functions in command line and as well as in other scripts also..
Can anyone please tell me that is it possible?
Source this function collection/library in your other scripts to make them available. For "using on command line" you might want to specify a bit more what you mean by that.
If sourced properly, you should be able to re-use the code from within other scripts and or the (bash) shell (e.g. by sourcing your code from /etc/bashrc).