![]() |
|
|
|
|
|||||||
| Forums | Portal | Register | Forum Rules | FAQ | Contribute | Members List | Arcade | Search | Today's Posts | Mark Forums Read |
| UNIX for Dummies Questions & Answers If you're not sure where to post a UNIX or Linux question, post it here. All UNIX and Linux newbies welcome !! |
|
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| problem in awk command | viveksnv | Shell Programming and Scripting | 3 | 03-03-2008 12:59 AM |
| problem with tr command | ravi raj kumar | UNIX for Advanced & Expert Users | 2 | 07-02-2007 03:41 AM |
| problem with dd command or maybe AFS problem | Anta | Shell Programming and Scripting | 0 | 08-25-2006 07:10 AM |
| ls command problem | buckhtr77 | SUN Solaris | 2 | 12-06-2005 12:16 PM |
| Problem while using Sed command | gopskrish | UNIX for Dummies Questions & Answers | 2 | 06-27-2005 08:26 AM |
|
|
Submit Tools | LinkBack | Thread Tools | Display Modes |
|
|||
|
if command -problem
Hi,
This is Vasikaran, I am just trying to run the if command using this test program, but while running , i am getting the syntax error as "syntax error: unexpected end of file" this is the test program ****************** echo " enter number" read num echo "Enter the choice of you want to see " echo "1. 1message" echo "2. 2message" echo "3. 3message" read choice if (choice=1) then echo "This is reading the first choice" endif Pls note : i am running this program in linux environment Thanks for the help in advance. Vasikaran |
| Forum Sponsor | ||
|
|
|
|||
|
Still problem persists
Thanks for the reply..
I have tried using if .........fi command but while trying i am getting this below mentioned error.. pls help Ofcourse case statement is working, but i want to work it out with If statement.. "syntax error near unexpected token `fi' search1.sh: line 16: `fi'" Thanks and Regards Vasikaran |
|
||||
|
Neither of the suggestions will work for the OP as he is using a csh base shell. I'm pretty rusty on csh but I think it should be something like
Code:
echo " enter number"
read num
echo "Enter the choice of you want to see "
echo "1. 1message"
echo "2. 2message"
echo "3. 3message"
read choice
if ( $choice == 1 ) then
echo "This is reading the first choice"
endif
|
|
|||
|
sending you the code and error message, still, error persists.. pls help
Actually i am trying the following code when in run this program in linux environment
echo " enter the mobile number " read mob echo "Enter the choice of log you want to see " echo "1. F.log" echo "2. A.log" echo "3. I.log" echo "4. R.log" echo "5. M.log" echo "6. A.log" read choice if [ $choice == 1 ] then echo "This will give the contents present in f.log" grep $mob /data/logs/f.log | cut -f1,2,4,5,11 -d" " endif the error message i am getting as "line 17: syntax error: unexpected end of file" |
|||
| Google The UNIX and Linux Forums |