error when i run my script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting error when i run my script
# 1  
Old 09-02-2005
error when i run my script

Hi,

When i run the below script,

#! /bin/csh
set userid=ficctprd
set kadir=KA_SWCCT_UK_lnswpsm05
setenv pidval `ps -ef | grep keepalive | grep -v keepaliveStub | grep -i $userid | grep -v grep | awk '{ print $2
}'`

I am getting the error "Unmatched ` ".

Could someone please help me to fx this?

Thanks,
Sateesh
# 2  
Old 09-02-2005
In your example the final line is:

Code:
}'`

This should be at the end of the previous line. Should work then.
# 3  
Old 09-03-2005
That's right. One of the differences between C-shells and Bourne-shells is that in Bourne derived shells, if you start quoted text while entering a command (i.e., with a ' or "), a newline does not end the command, but the shell continues the command entry until the quoted text is closed by another ' or ". So, e.g., you can do
Code:
awk 'print { $0 }
       print { $1 }'

I.e., this is one command, but spans mutlitple lines, even without the newline being escaped with a line-terminal backslash, \. But in the csh -- a minor disadvantage I think -- the newline will end a command in this case. So if you want to span a command over several lines in csh, end each line (escept the last) with a backslash (or simply put everything on one line). You're script above seems to betray that you are used to coding in Bourne-derived shells, where you are accustomed to seeing such multiline commands with quotes (or maybe yours was just a typo).

Last edited by hadarot; 09-03-2005 at 12:55 AM..
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script run in a case statement call to run a php file, also Perl

Linux System having all Perl, Python, PHP (and Ruby) installed From a Shell script, can call a Perl, Python, PHP (or Ruby ?) file eg eg a Shell script run in a case statement call to run a php file, also Perl or/and Python file??? Like #!/usr/bin/bash .... .... case $INPUT_STRING... (1 Reply)
Discussion started by: hoyanet
1 Replies

2. Shell Programming and Scripting

Script fails to run properly when run from CRONTAB

Hello all, I'm trying to write a script to gather and send data and it works just fine at the bash command line, but when executing from CRON, it does not run properly. My scripting skills are pretty limited and there's probably a better way, but as I said it works at the command line, but... (12 Replies)
Discussion started by: rusman
12 Replies

3. Shell Programming and Scripting

how to run an already made script run against a list of ip addresses solaris 8 question

how to run an already developed script run against a list of ip addresses solaris 8 question. the script goes away and check traffic information, for example check_GE-VLANStats-P3 1.1.1.1 and returns the results ok. how do I run this against an ip list? i.e a list of 30 ip addresses (26 Replies)
Discussion started by: llcooljatt
26 Replies

4. Shell Programming and Scripting

ssh run script error

Hello when try to excute the following ssh -l pla 10.287.60.55 vis_fil vis_fil not found. but it works fine when login to the server. can you help me run this command in one online because i will add later to shell script regards (1 Reply)
Discussion started by: mogabr
1 Replies

5. Shell Programming and Scripting

ssh - run shell script - Error

Hi Team, I am trying to run shell script from one server to another server with below command. ssh abc@pqr.america.com /tmp/test.ksh But, it gives below error. Can someone help me what is the issue? exec(): 0509-036 Cannot load program ssh because of the following errors: ... (3 Replies)
Discussion started by: ace_friends22
3 Replies

6. Solaris

Shell Script gives error when run through cron job.

Hi, The following shell script runs without any problem when executed manulally. USED=$(df -h /arch | tail -1 | awk '{print $5}' | cut -d '%' -f 1) if then find /arch/AUBUAT/ -type f -mtime +0 | xargs rm find /arch/AUBMIG/ -type f -mtime +0 | xargs rm fi But the same gives below... (6 Replies)
Discussion started by: ksadiq79
6 Replies

7. Shell Programming and Scripting

Run a bash script, display on the screen and save all information in a file including error info

Hi all, How to: Run a bash script, display on the screen and save all information in a file including error information. For example: I have a bash script called test.sh now I want to run the test.sh and display the output on the screen and save the output including error info to a file. ... (1 Reply)
Discussion started by: Damon sine
1 Replies

8. Shell Programming and Scripting

found error 138 while run shell script

I found error 138 while run a shell script. Please tell me what it's mean?? and how can i prevent that error. Thanks in advance..... (1 Reply)
Discussion started by: rinku
1 Replies

9. Shell Programming and Scripting

Shell script run error ksh: not found

Hi All, I am trying to run a script to FTP files from one UNIX server to another UNIX server. Actually I can able to FTP file successfully by manually or paste whole script at prompt. But when I am trying to run script it is giving error. Please let me know the cause. #!/bin/sh... (3 Replies)
Discussion started by: nz80qy
3 Replies
Login or Register to Ask a Question