The UNIX and Linux Forums  


Go Back   A UNIX és Linux Forums > Top Fórumok > Shell programozás és Scripting
.
google unix.com



Shell programozás és Scripting Post kérdések KSH, CSH, SH, Bash, Perl, PHP, SED, AWK ÉS EGYÉB shell szkriptek és shell script nyelvek itt.

Több, UNIX és Linux fórum témák Ön által talált Hasznos
Szál Thread Starter Fórum Válaszok Utolsó hozzászólás
'end of file "váratlan srisreeku Shell programozás és Scripting 1 04-28-2008 03:39 PM
váratlan fájl vége naveeng.81 Shell programozás és Scripting 1 03-11-2008 06:43 AM
váratlan fájl vége dineshr85 Shell programozás és Scripting 2 10-15-2007 03:47 AM
'end of file "váratlan abhijeetkul Shell programozás és Scripting 4 04-10-2006 07:42 AM
Gunzip: Unexpected end of file Dolly A UNIX a dummies Kérdések és válaszok 1 09-26-2002 06:34 AM

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Téma eszközök Keresés a téma Rate Thread Megjelenítési módok
  #1 (permalink)  
Old 10-11-2008
weatherman0516 weatherman0516 is offline
Regisztrált felhasználó
  
 

Join Date: Oct 2008
Hozzászólások: 4
'end of file "váratlan

HELP PLEASE!

Én vagyok ez a szkript fut, és úgy tartja, hogy az error 'end of file "váratlan. Tudom, hogy általában azt jelenti, zárójelben, vagy bármi is az, de én vidám talál semmit! Én vagyok az új betűtípust, és én egy kis "print" staements és nem kapok múltban az első IF nyilatkozat i dont gondol. Itt van a script. Köszi előre


Kód:
#!/bin/sh
echo "Please enter a station: \c"
read station
echo "Please enter the desired timestamp: \c"
read timestamp
cp PBLplot.pro $station/$timestamp
cd $station/$timestamp/
echo "Would you like to plot (1) 4panel with one var per map or (2) 4panel all vars per map: \c"
read choice
echo "$choice"
if "$choice" -eq 1
then
   echo "Please enter temperature variable (Skin, Tmpc, T10m, T20m, Dwpc, Ts01, Ts02): \c"
   read temperature
   echo "Please enter flux variable (Sens, Soil, Latn, Snof, Rdwn, Fupf, Sped): \c"
   read fluxvar
   echo "Please enter boundary layer variable (Hpbl, Fclc, Zlcl, Thbr, Shbr, Tdir, Tspd): \c"
   read bl
   echo "Please enter solar radiation variable (Sold, Solu, Atmr, Terr, Netr, Sumr, Bown): \c"
   read solarrad
   echo "Do you want to save this plot?: \c"
   read saveplot
   echo "Enter a file name (no extensions please): \c"
   read filename
   idl<<EOF
   .compile PBLplot.pro
   PBL
   $timestamp
   $choice
   $temperature
   $fluxvar
   $bl
   $solarrad
   $saveplot
   $filename
   exit
   EOF
elif "$choice" -eq 2
then
   echo "Do you want to save this plot?: \c"
   read saveplot
   echo "Enter a file name (no extensions please): \c"
   read filename
   idl<<EOF   
   .compile PBLplot.pro
   PBL
   $timestamp
   $choice
   $saveplot
   $filename
   exit
   EOF
fi
   
echo "continue" 
   
rm PBLplot.pro

#

Last edited by Franklin52; 10/11/2008 at 01:10 PM.. Ok: hozzá kódot tags
  #2 (permalink)  
Old 10-11-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderátor
  
 

Join Date: Feb 2007
Hozzászólások: 4.342
A szintaxis a nyilatkozat, ha nem megfelelő, cserélje ki a nyilatkozatot, és ha elif az:


Kód:
if [ "$choice" -eq 1 ]

and

elif [ "$choice" -eq 2 ]

Vigyázni kell, mert a terek körül zárójelben.

Kérem, helyezze el a kódot a kód tags következő alkalommal, hogy javítsa az olvashatóság. Válaszd ki a kódot, és kattintson a # szimbólum felett editing ablakot.

Üdvözlettel
  #3 (permalink)  
Old 10-11-2008
weatherman0516 weatherman0516 is offline
Regisztrált felhasználó
  
 

Join Date: Oct 2008
Hozzászólások: 4
Köszönöm a gyors választ, láthatjuk most, hogy már megváltoztatta a mondattan, de vagyok még, hogy az ugyanazt a hibát .... más javaslatok?


Kód:
#!/bin/sh

echo "Please enter a station: \c"
read station
echo "Please enter the desired timestamp: \c"
read timestamp

cp PBLplot.pro $station/$timestamp
cd $station/$timestamp/

echo "Would you like to plot (1) 4panel with one var per map or (2) 4panel all vars per map: \c"
read choice
echo "$choice"

if [ "$choice" -eq 1 ]
then
   echo "Please enter temperature variable (Skin, Tmpc, T10m, T20m, Dwpc, Ts01, Ts02): \c"
   read temperature
   echo "Please enter flux variable (Sens, Soil, Latn, Snof, Rdwn, Fupf, Sped): \c"
   read fluxvar
   echo "Please enter boundary layer variable (Hpbl, Fclc, Zlcl, Thbr, Shbr, Tdir, Tspd): \c"
   read bl
   echo "Please enter solar radiation variable (Sold, Solu, Atmr, Terr, Netr, Sumr, Bown): \c"
   read solarrad
   echo "Do you want to save this plot?: \c"
   read saveplot
   echo "Enter a file name (no extensions please): \c"
   read filename
   idl<<EOF
   .compile PBLplot.pro
   PBL
   $timestamp
   $choice
   $temperature
   $fluxvar
   $bl
   $solarrad
   $saveplot
   $filename
   exit
   EOF
elif [ "$choice" -eq 2 ]
then
   echo "Do you want to save this plot?: \c"
   read saveplot
   echo "Enter a file name (no extensions please): \c"
   read filename
   idl<<EOF   
   .compile PBLplot.pro
   PBL
   $timestamp
   $choice
   $saveplot
   $filename
   exit
   EOF
fi
   
echo "continue" 
   
rm PBLplot.pro  
   
#

  #4 (permalink)  
Old 10-11-2008
otheus's Avatar
otheus otheus is offline Forum Staff  
Moderátor ala Mode
  
 

Join Date: Feb 2007
Helyszín: Innsbruck, Ausztria
Hozzászólások: 1891
És [valójában egy symlink (vagy más néven), hogy a "teszt". Szóval te is megtehetik:


Kód:
if test "$choice" -eq 1

  #5 (permalink)  
Old 10-11-2008
weatherman0516 weatherman0516 is offline
Regisztrált felhasználó
  
 

Join Date: Oct 2008
Hozzászólások: 4
kipróbálás után mindkét javaslatot még hozamokat ugyanazon a hiba.
  #6 (permalink)  
Old 10-11-2008
Franklin52 Franklin52 is offline Forum Staff  
Moderátor
  
 

Join Date: Feb 2007
Hozzászólások: 4.342
Távolítsuk el a szóközöket előtt EOF:


Kód:
   idl<<EOF
   .compile PBLplot.pro
   PBL
   $timestamp
   $choice
   $temperature
   $fluxvar
   $bl
   $solarrad
   $saveplot
   $filename
   exit
EOF

Üdvözlettel
  #7 (permalink)  
Old 10-11-2008
weatherman0516 weatherman0516 is offline
Regisztrált felhasználó
  
 

Join Date: Oct 2008
Hozzászólások: 4
Ti vagytok a legjobb barátom !!!!!!! Köszönöm szépen. Have a great weekend!
Closed Thread

Könyvjelzõk

Téma eszközök Keresés a téma
Keresés a téma:

Részletes keresés
Megjelenítési módok Rate this thread
Rate this thread:

Posting szabályzat
Ön nem post new threads
Ön nem post válaszok
Ön nem post Csatolmányok
Ön nem szerkeszteni az üzeneteidet

BB kód van Be
Smilies vannak Be
[IMG] kód Be
HTML kód Ki
Trackbacks vannak Be
Pingbacks vannak Be
Refbacks vannak Be




Minden idő GMT -4. Az idő most 04:38 AM.


Powered by: vBulletin, Copyright © 2000 - 2006, Jelsoft Enterprises Limited. Nyelvre lefordítva Powered by .
vBCredits v1.4 Copyright © 2007 - 2008, PixelFX Studios
A UNIX és Linux Fórum Tartalom Copyright © 1993-2009. Minden jog Reserved.Ad menedzsment RedTyger

Content Relevant URLs by vBSEO 3.2.0