File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
A friendly place for programming greenhorns!
Big Moose Saloon
Search
|
Java FAQ
|
Recent Topics
Register / Login
JavaRanch
»
Java Forums
»
Engineering
»
Linux / UNIX
Author
if else in Script
Akhilesh Trivedi
Ranch Hand
Joined: Jun 22, 2005
Posts: 1493
posted
Nov 30, 2011 05:44:43
0
var = 'Y' if $var='Y' then echo "Yes" else echo "No" fi
I have the above script, when i run it, i get
syntax error at line 4 : `else' unexpected
why?
Keep Smiling Always — My life is smoother when running silent. -paul
[
FAQs
] [
Certification Guides
] [
The Linux Documentation Project
]
Peter Johnson
author
Bartender
Joined: May 14, 2008
Posts: 5533
I like...
posted
Nov 30, 2011 12:20:21
1
Which shell are you using? For bash, I usually use:
var='Y' if [ $var = 'Y' ]; then echo "Yes" else echo "No" fi
JBoss In Action
Akhilesh Trivedi
Ranch Hand
Joined: Jun 22, 2005
Posts: 1493
posted
Nov 30, 2011 23:12:41
0
Thanks i was on ksh.
I agree. Here's the link:
http://aspose.com/file-tools
subject: if else in Script
Similar Threads
How to retain the value of drop down on click of browser back button
get value on click from table using javascript
Search on a string
applet refresh event
jquery - ID dos not appere in --> getJSON
All times are in JavaRanch time: GMT-6 in summer, GMT-7 in winter