Skip to main content
edited tags
Link
Jeff Schaller
  • 68.8k
  • 35
  • 122
  • 264
added 227 characters in body
Source Link
Sharan
  • 103
  • 1
  • 1
  • 4

I am literally new to the scripting language.

I have to run source ~/.custom_rc command from within a shell script. When I run the shell script, It doesn't show any error. It run just fine.

Here is my install.sh file.

#!/usr/bin/env bash
#
# Some Comments
#
# End of Comments

echo ""
.
.
.
.
.
.
source ~/.custom_rc

echo "End Of Script..."

I am executing the script from curl using sh -c like,

sh -c "$(curl -fsSL https://some.link/to/install.sh)"

Why the command isn't running inside the script? How am I supposed to make them run inside shell scripting?

EDIT #1:

I am using alias commands inside the .custom_rc file.

Once the execution completed, I am unable to use the alias commands.

But, when I manually run source ~/.custom_rc, alias commands works fine.

I am literally new to the scripting language.

I have to run source ~/.custom_rc command from within a shell script. When I run the shell script, It doesn't show any error. It run just fine.

Here is my install.sh file.

#!/usr/bin/env bash
#
# Some Comments
#
# End of Comments

echo ""
.
.
.
.
.
.
source ~/.custom_rc

echo "End Of Script..."

I am executing the script from curl using sh -c like,

sh -c "$(curl -fsSL https://some.link/to/install.sh)"

Why the command isn't running inside the script? How am I supposed to make them run inside shell scripting?

I am literally new to the scripting language.

I have to run source ~/.custom_rc command from within a shell script. When I run the shell script, It doesn't show any error. It run just fine.

Here is my install.sh file.

#!/usr/bin/env bash
#
# Some Comments
#
# End of Comments

echo ""
.
.
.
.
.
.
source ~/.custom_rc

echo "End Of Script..."

I am executing the script from curl using sh -c like,

sh -c "$(curl -fsSL https://some.link/to/install.sh)"

Why the command isn't running inside the script? How am I supposed to make them run inside shell scripting?

EDIT #1:

I am using alias commands inside the .custom_rc file.

Once the execution completed, I am unable to use the alias commands.

But, when I manually run source ~/.custom_rc, alias commands works fine.

Source Link
Sharan
  • 103
  • 1
  • 1
  • 4

source command is not working inside a shell script

I am literally new to the scripting language.

I have to run source ~/.custom_rc command from within a shell script. When I run the shell script, It doesn't show any error. It run just fine.

Here is my install.sh file.

#!/usr/bin/env bash
#
# Some Comments
#
# End of Comments

echo ""
.
.
.
.
.
.
source ~/.custom_rc

echo "End Of Script..."

I am executing the script from curl using sh -c like,

sh -c "$(curl -fsSL https://some.link/to/install.sh)"

Why the command isn't running inside the script? How am I supposed to make them run inside shell scripting?