![]() |
|
|
google unix.com
|
|||||||
| Forums | Registreer | Forum Regels | Links | Albums | Veelgestelde vragen | Ledenlijst | Kalender | Zoeken | Today's Posts | Markeer forums als gelezen |
| Programmeren en Shell Scripting Post vragen over KSH, CSH, SH, Bash, Perl, PHP, sed, awk en andere shell scripts en shell scripting talen hier. |
Meer UNIX en Linux Forum Onderwerpen Misschien vindt u Helpful
|
||||
| Draad | Thread Starter | Forum | Antwoorden | Last Post |
| 'einde bestand' onverwachte | srisreeku | Programmeren en Shell Scripting | 1 | 04-28-2008 03:39 PM |
| onverwacht einde van bestand | naveeng.81 | Programmeren en Shell Scripting | 1 | 03-11-2008 06:43 |
| onverwacht einde van bestand | dineshr85 | Programmeren en Shell Scripting | 2 | 10-15-2007 03:47 |
| 'einde bestand' onverwachte | abhijeetkul | Programmeren en Shell Scripting | 4 | 04-10-2006 07:42 |
| Gunzip: onverwacht einde van bestand | Dolly | UNIX voor Dummies Questions & Answers | 1 | 09-26-2002 06:34 |
![]() |
|
|
LinkBack | Thread Tools | Zoeken in deze Thread | Rate Thread | Display Modes |
|
|
|
||||
|
'einde bestand' onverwachte
PLEASE HELP! Ik ben draait dit script, en ik krijg steeds de foutmelding 'einde bestand' onverwacht. Ik weet dat betekent meestal haakjes of wat dan ook niet op zijn plaats, maar i cant vinden! Ik ben nieuw voor scripting en ik heb enkele "print" staements in en het is niet om voorbij de eerste if statement i dont think. Hier is het script. Thanks in advance Code:
#!/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 # Laatst gewijzigd door Franklin52; op 10.11.2008 01:10 PM.. Reden: toevoeging van code-tags |
|
||||
|
De syntax van het if statement is niet goed, in de plaats indien en elif verklaring met: Code:
if [ "$choice" -eq 1 ] and elif [ "$choice" -eq 2 ] Pas op voor de ruimten rond de haakjes. Gelieve uw code tussen code tags komende tijd om de leesbaarheid te verbeteren. Selecteer uw code in en klik op de #-symbool boven het bewerken venster. Groeten |
|
||||
|
Dank u voor de snelle reactie, zie je nu dat ik zijn veranderd de syntax, maar ben nog steeds dezelfde fout .... alle andere suggesties? Code:
#!/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 # |
![]() |
| Bladwijzers |
| Thread Tools | Zoeken in deze Thread |
| Display Modes | Beoordeel deze draad |
|
|