Shell script - source is not taking - WHY?

Status
Not open for further replies.

V

Member level 3
Joined
Jan 20, 2005
Messages
67
Helped
0
Reputation
0
Reaction score
0
Trophy points
1,286
Activity points
500
#!/bin/bash -f


# My first shell script - name_script.csh

echo "======================================================"
echo "=== MY First script - ENJOY ==="
echo "======================================================"

pwd
cd ../..


pwd
source build_env/my_design.csh user_name ---NOT WORKING

cd user_name/dir1/

make my_first_example


In this script why source is not taking????? any idea

on terminal i am getting this msg......
./name_script.csh: source: not found


Thanks for help in advn..
 

where does you file build_env/my_design.csh is located.Is it in present working directory pwd/build_env/my_design.csh



#!/bin/bash -f


# My first shell script - name_script.csh

echo "======================================================"
echo "=== MY First script - ENJOY ==="
echo "======================================================"

pwd
cd ../..


pwd
source build_env/my_design.csh user_name ---NOT WORKING

cd user_name/dir1/

make my_first_example
 

The error message says that the path of file my_design.csh is not correct.
You can use absolutely path for source. so your code:

"pwd
cd ../..

pwd
source build_env/my_design.csh user_name

"
can be replaced by:
source /xxx/xxx/build_env/my_design.csh user_name

(/xxx/xxx is the parent directory of build_env)

and it will work.


Ryan
 

Status
Not open for further replies.
Cookies are required to use this site. You must accept them to continue using the site. Learn more…