Sponsored Content
Top Forums Shell Programming and Scripting Irritating Shell script problem - " unmatched Post 302591626 by chris01010 on Friday 20th of January 2012 06:34:30 AM
Old 01-20-2012
Irritating Shell script problem - " unmatched

Hi,

I have the below KSH shell script:

Code:
#!/usr/bin/ksh
 
if [ $1 = "" ]; then
    echo "Usage: resourceSts <server>
else
  if [ $1 = "abc1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
 
   elif [ $1 = "abc2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "def1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "def2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "ghi1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "ghi2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
 
   elif [ $1 = "jkl1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "jkl2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "mno1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "mno2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "pqr1" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
   elif [ $1 = "pqr2" ]; then source="<server>"
      ssh <userid>@$source > output 2>/dev/null <<_EOF
      scstat -g
      _EOF
  fi  
fi

but when I execute it I get the error:

./resourceSts: syntax error at line 65: `"' unmatched

I'm pretty certain it's just a typo, but for life of me I can't find it. Anyone have any ideas?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Script scheduling problem using "at" command

Hello! I'm writing a shell script that will monitor if a server is up or down. I would like to use the command "at" inside of my script to reschedule the script to run in 2 minutes but I can't pass parameters to my script and this is my problem... This is the idea behind the script: ... (2 Replies)
Discussion started by: ben631
2 Replies

2. Shell Programming and Scripting

Q: Recording shell script screen output using "script" command ?

Hello, I need to capture everything showed on a screen by a shell script which needs user interaction. The shell script performs commads such as rsh so normal redirection to a file does not work. I know there is a special unix command call "script" which records screen session but the... (4 Replies)
Discussion started by: lalfonso.gomez
4 Replies

3. Shell Programming and Scripting

Getting error "syntax error at line 78 : `<' unmatched"

Hi Guys, I have a following code in cm1.sh script. cnt=`sqlplus -s <un>/<pwd> << !EOF set heading off verify off pagesize 0 select count(*) from fnd_svc_components where component_name like '%Mailer%' and component_status != 'RUNNING'; exit; !EOF` echo $cnt if ; then sqlplus -s... (1 Reply)
Discussion started by: sshah1001
1 Replies

4. Shell Programming and Scripting

"<< Unmatched" in ksh script using sftp

Getting "syntax error at line 19: `<<' unmatched" trying to run sftp in a ksh script. ...snip... 13 for each in $HOSTS; 14 do 15 if ; 16 then mkdir /usr/restore/$each 17 fi 18 cd /usr/restore/$each 19 sftp -b - server-1 <<EOF 20 get... (6 Replies)
Discussion started by: michaelak28
6 Replies

5. Shell Programming and Scripting

"else" unmatched error in shell script.

Friends I have pasted a script below d08083: cat tests #!/bin/ksh if then rm -r Last-Previous mv Previous Last-Previous mv Current Previous mkdir Current #cd Current mv $1 Current else cd Current mv "$1\$2" Current\*\ fi (4 Replies)
Discussion started by: Renjesh
4 Replies

6. AIX

"too big" and "not enough memory" errors in shell script

Hi, This is odd, however here goes. There are several shell scripts that run in our production environment AIX 595 LPAR m/c, which has sufficient memory 14GB (physical memory) and horsepower 5CPUs. However from time to time we get the following errors in these shell scripts. The time when these... (11 Replies)
Discussion started by: jerardfjay
11 Replies

7. Programming

fork&pipe "interpretting" shell - problem

hello everybode.Got some sort of "problems" with this stuff; well this is a program int main() { int Pipe; int origStdin, origStdout; int childPID; origStdin = dup(0); origStdout = dup(1); pipe(Pipe); if( (childPID = fork()) < 0 ) { perror(... (2 Replies)
Discussion started by: IdleProc
2 Replies

8. UNIX Desktop Questions & Answers

Will this be a problem in my script "#! /bin/ksh" ?

All, In my script i am having the first line as "#! /bin/ksh" I see there is a space between #! and /bin .. My script is working fine and it is not causing any problem.But some time this script is very slow in processing and even some time the script hangs we need to kill and... (5 Replies)
Discussion started by: arunkumar_mca
5 Replies

9. Shell Programming and Scripting

problem executing awk in shell "not found"

Hello, The INPUT file a.txt contains this a a a b b b I'm trying to execute this shell script from the Unix Command Line like this: ./k.sh a.txt > newfile.txt #!/usr/bin/sh infile="$1" awk '{print $0;}' < $infile I get this error message on the command line: (9 Replies)
Discussion started by: script_op2a
9 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
FDFORMAT(8)						     Linux Programmer's Manual						       FDFORMAT(8)

NAME
fdformat - Low-level formats a floppy disk SYNOPSIS
fdformat [-n] device DESCRIPTION
fdformat does a low level format on a floppy disk. device is usually one of the following (for floppy devices, the major = 2, and the minor is shown for informational purposes only): /dev/fd0d360 (minor = 4) /dev/fd0h1200 (minor = 8) /dev/fd0D360 (minor = 12) /dev/fd0H360 (minor = 12) /dev/fd0D720 (minor = 16) /dev/fd0H720 (minor = 16) /dev/fd0h360 (minor = 20) /dev/fd0h720 (minor = 24) /dev/fd0H1440 (minor = 28) /dev/fd1d360 (minor = 5) /dev/fd1h1200 (minor = 9) /dev/fd1D360 (minor = 13) /dev/fd1H360 (minor = 13) /dev/fd1D720 (minor = 17) /dev/fd1H720 (minor = 17) /dev/fd1h360 (minor = 21) /dev/fd1h720 (minor = 25) /dev/fd1H1440 (minor = 29) The generic floppy devices, /dev/fd0 and /dev/fd1, will fail to work with fdformat when a non-standard format is being used, or if the for- mat has not been autodetected earlier. In this case, use setfdprm(8) to load the disk parameters. OPTIONS
-n No verify. This option will disable the verification that is performed after the format. SEE ALSO
fd(4), setfdprm(8), mkfs(8), emkfs(8) AUTHOR
Werner Almesberger (almesber@nessie.cs.id.ethz.ch) AVAILABILITY
The fdformat command is part of the util-linux package and is available from ftp://ftp.kernel.org/pub/linux/utils/util-linux/. Linux 0.99 1 February 1993 FDFORMAT(8)
All times are GMT -4. The time now is 01:51 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy