Source command returns error when it strikes conditional statement "ifeq"


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Source command returns error when it strikes conditional statement "ifeq"
# 1  
Old 12-11-2012
Source command returns error when it strikes conditional statement "ifeq"

Hello All,
I am running source command on my project configuration file app.cfg which has conditional statements with make file systax E.g
Code:
ifeq ($(APP_CMP_DIR),trunk)

.
When I source this file it throws error:
Code:
 syntax error near unexpected token `$(APP_CMP_DIR),trunk'

.

All conditional statements are not indented which is prerequisite for make file syntax.

I doubt whether we can source files with conditional statements or not.
Any alternative way to get configuration variables in shell environment ??

Regards,
Anand Shah
# 2  
Old 12-14-2012
I seems good; maybe the else or endif are accidentally in quotes or parens?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to run "finger" command in an if statement?

I have been trying to run the finger command in a if statement but its giving me a bunch of errors. gidlistTemp="g274gG;g2759C;g28320;g2885G;g2A276;g23338;g2A5h5;g2A307" for i in $(echo $gidlistTemp| tr ';' ' \n') do tst=(finger $i | wc -l) if then ... (4 Replies)
Discussion started by: ajetangay
4 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. Shell Programming and Scripting

AIX's "bc" Command: Doing a Conditional Expression?

Hello All, I'm trying to issue a conditional expression using "bc" on floating point numbers. I had this working on my linux box, but as soon as I transferred the file over to an AIX Server, it would not work anymore... This is the "WORKING" command on linux (below), which I can't seem to... (8 Replies)
Discussion started by: mrm5102
8 Replies

4. Shell Programming and Scripting

sed returns error "sed: -e expression #1, char 18: unterminated `s' command"

Hello All, I have something like below LDC100/rel/prod/libinactrl.a LAA2000/rel/prod/libinactrl.a I want to remove till first forward slash that is outputshould be as below rel/prod/libinactrl.a rel/prod/libinactrl.a How can I do that ??? (8 Replies)
Discussion started by: anand.shah
8 Replies

5. UNIX for Dummies Questions & Answers

Unix "look" Command "File too large" Error Message

I am trying to find lines in a text file larger than 3 Gb that start with a given string. My command looks like this: $ look "string" "/home/patrick/filename.txt" However, this gives me the following message: "look: /home/patrick/filename.txt: File too large" So, I have two... (14 Replies)
Discussion started by: shishong
14 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Red Hat

"ERROR : failed to mount nfs source" Red Hat Kickstart

Hi There, I have been googling for this error and try solution provided but still not avail to resolve Kickstart Issue. Any expert have encounter this problem? Thanks. Regards, Regmaster (4 Replies)
Discussion started by: regmaster
4 Replies

8. UNIX for Dummies Questions & Answers

how to install "source" command!/ broken "login.cl"!

Hello, I am new to this forums and this is my first "asking help" message! i have 2 problems: 1- for unknown reasons the "source" command is not avalable in my system (UBUNTU). i can't either see it in my bin directory! 2- again for unknown reasons the "login.cl" file in the home... (0 Replies)
Discussion started by: astrosona
0 Replies

9. UNIX for Dummies Questions & Answers

ps command returns a "?"

When I do the following command where jxh777 is my userid to see my processes, I see a question mark in the return. Does that mean anything ? ps -ef | grep jxh777 jxh777 9966 9965 0 16:47:46 pts/tb 0:00 -ksh jxh777 11660 9966 1 17:05:02 pts/tb 0:00 grep jhabi0 jxh777 28162 28160... (6 Replies)
Discussion started by: jxh461
6 Replies

10. UNIX for Dummies Questions & Answers

diff on c-source file always returns "files differ"

I have a c-source file that is evidently seen by unix as a binary file. When doing a diff between it and older versions with substantial differences, diff will only return "files differ". I have tried cat-ing the file to another file; tried using the "-h" on the diff; I have tried ftp-ing it... (7 Replies)
Discussion started by: C-Prog-Man
7 Replies
Login or Register to Ask a Question