Unrecognised error in script


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Unrecognised error in script
# 8  
Old 07-16-2010
I finally managed to reproduce the error message by using an old Bourne Shell.
The problem was obfuscated because your first script was called "date" but your second version was called "date.sh". It is not a good idea to name scripts the same name as unix commands.

What Operating System and version is your computer running?
Code:
uname -a

What do you get for the following command from your own account shell prompt:
Code:
echo ${SHELL}

Do you have a more modern shell like: ksh, bash or a Posix Shell ?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Shell script with sql script error

Hi All when I execute from psql prompt, I get the result, when I try to automate using a shell script, the query is not working # `/usr/bin/psql -U postgres -d coba1 -c "select name from users where "Date" > current_date - 30;"` ERROR: column "Date" does not exist LINE 1: select... (2 Replies)
Discussion started by: srilinux09
2 Replies

2. Shell Programming and Scripting

Calling shell script within awk script throws error

I am getting the following error while passing parameter to a shell script called within awk script. Any idea what's causing this issue and how to ix it ? Thanks sh: -c: line 0: syntax error near unexpected token `newline' sh: -c: line 0: `./billdatecalc.sh ... (10 Replies)
Discussion started by: Sudhakar333
10 Replies

3. Shell Programming and Scripting

Help with FTP Script which is causing "syntax error: unexpected end of file" Error

Hi All, Please hav a look at the below peice of script and let me know if there are any syntax errors. i found that the below peice of Script is causing issue. when i use SFTP its working fine, but there is a demand to use FTP only. please find below code and explain if anything is wrong... (1 Reply)
Discussion started by: mahi_mayu069
1 Replies

4. Shell Programming and Scripting

Error in calling a shell script from another script

HI, We are using two shell scripts, script.sh,env.sh, where env.sh will be called inside script.sh. The variable inside env.sh is used as $var in script.sh.But while running the script its not identifying that variable. Is there any permission needed to call a script inside another script. ... (3 Replies)
Discussion started by: banupriyat
3 Replies

5. UNIX for Dummies Questions & Answers

Re: Script Error [syntax error at line]

Hi , I Have Written A Simple Script To Check Greatest Of '2' Number When Execuating The Script I Am Getting The Below Error SP11: if:not found SP11: line 4:syntax error at line 5:'then' unexpexted And The Program I Have Wrriten For This #!bin/ksh echo "Enter Two Numbers"... (3 Replies)
Discussion started by: anudeepkumar123
3 Replies

6. Shell Programming and Scripting

Syntax error calling TCL script from shell script

hello everyone i am beginner on shell scripting .and i am working on my project work on ad hoc network i wrote a batch (.sh) to do a looping and execute a tcl script i wrote before in each iteration ..but i got this problem " syntax error near unexpected token `('... (1 Reply)
Discussion started by: marcoss90
1 Replies

7. Shell Programming and Scripting

How to grep sql error in shell script and exit the script?

I need help in the following script. I want to grep the sql errors insert into the error table and exit the shell script if there is any error, otherwise keep running the scripts. Here is my script #!/bin/csh -f source .orapass set user = $USER set pass = $PASS cd /opt/data/scripts echo... (2 Replies)
Discussion started by: allinshell99
2 Replies

8. Windows & DOS: Issues & Discussions

Error opening script file - location error

Hello, I know nothing about UNIX, ftp, etc. I am building an excel VBA macro which calls a .bat file. I've taken a pre-existing batch file and am trying to modify it to fit my purposes. I would be very grateful for some assistance. Here is my .bat file: echo off set... (9 Replies)
Discussion started by: starcraftbud
9 Replies

9. Shell Programming and Scripting

Script with error output but continuation in script?

I have written a basic fetching script. The script logs into an FTP site, downloads a .zip file, then unzips and moves the files to the necessary folders, then deletes them, etc. The problem I have is if one of the files no longer exists on the FTP site or another part of the script fails, then... (3 Replies)
Discussion started by: daem0n
3 Replies

10. UNIX for Dummies Questions & Answers

awk Shell Script error : "Syntax Error : `Split' unexpected

hi there i write one awk script file in shell programing the code is related to dd/mm/yy to month, day year format but i get an error please can anybody help me out in this problem ?????? i give my code here including error awk ` # date-month -- convert mm/dd/yy to month day,... (2 Replies)
Discussion started by: Herry
2 Replies
Login or Register to Ask a Question
scsnapshot(1M)						  System Administration Commands					    scsnapshot(1M)

NAME
scsnapshot - retrieve configuration data about resource groups, resource types, and resources, and generate a shell script SYNOPSIS
scsnapshot [-s scriptfile] [-o imagefile] scsnapshot [-s scriptfile] oldimage newimage DESCRIPTION
Note - Beginning with the Sun Cluster 3.2 release, Sun Cluster software includes an object-oriented command set. Although Sun Cluster software still supports the original command set, Sun Cluster procedural documentation uses only the object-oriented command set. For more infor- mation about the object-oriented command set, see the Intro(1CL) man page. The scsnapshot tool retrieves information from the Cluster Configuration Repository (CCR) about configuration data that is related to resource groups, resource types, and resources. The scsnapshot tool formats the configuration data as a shell script that can be used for the following purposes: o To replicate configuration data on a cluster that has no configured resource groups, resource types, and resources o To upgrade configuration data on a cluster that has configured resource groups, resource types, and resources The scsnapshot tool retrieves configuration data only from the CCR. Other configuration data is ignored. The scsnapshot tool does not take into account the dynamic state of different resource groups, resource types, and resources. You can use this command only in the global zone. OPTIONS
The following options are supported by the scsnapshot tool. If you use an incorrect command option, the correct way to use the command option is displayed. -s scriptfile Stores the generated script in a file called scriptfile. You can use this option only in the global zone. If this option is not specified, the generated script is written to the standard output. If a file called scriptfile already exists, it is renamed as scriptfile.old, and a new file called scriptfile is created. If a file called scriptfile.old already exists, it is overwritten. -o imagefile Stores the generated image file in a file called imagefile. You can use this option only in the global zone. If this option is not specified, an image file is not generated. If a file called imagefile already exists, it is renamed as imagefile.old, and a new file called imagefile is created. If a file called imagefile.old already exists, it is overwritten. oldimage Specifies an image file that contains the old configuration data. newimage Specifies an image file that contains the new configuration data. EXTENDED DESCRIPTION
The output of the scsnapshot tool is an executable Bourne shell-based script. Before you run the script, you might need to manually change some properties to reflect the features of your host. The script compares the following characteristics of the local cluster to the cluster where the script was generated: o Machine architecture o Version of the Solaris Operating System o Version of the Sun Cluster software If the characteristics are not the same, the script writes an error and ends. A message asks whether you want to rerun the script by using the -f option. The -f option forces the script to run, despite any difference in characteristics. The script generated by the scsnapshot tool verifies that the Sun Cluster resource type exists on the local cluster. If the resource type does not exist on the local cluster, the script writes an error and ends. A message asks whether you want to install the missing resource type before you run the script again. To run a script that is generated by the scsnapshot tool, you need solaris.cluster.resource.modify RBAC authorization. For more informa- tion, see the rbac(5) man page. USAGE
This section describes how you can use the scsnapshot tool. Retrieving Configuration Data for Resource Groups, Resource Types, and Resources scsnapshot [-s scriptfile] [-o imagefile] Used without the -o option, the scsnapshot tool generates a script that creates configuration data for clusters that do not already have configured resource groups, resource types, and resources. See Example 1. Used with the -o option, the scsnapshot tool produces an image file that represents the configuration data. The image file can be used in further invocations of the scsnapshot tool to upgrade configuration data on a cluster. See Example 2. To use the scsnapshot tool to retrieve configuration data, you need solaris.cluster.resource.read role-based access control (RBAC) autho- rization. For more information, see the rbac(5) man page. To track differences between versions of configuration data, store the image files in a source control system such as SCCS. Upgrading Configuration Data for Resource Groups, Resource Types, and Resources scsnapshot [-s scriptfile] oldimage newimage The scsnapshot tool generates a shell script that can be used to upgrade the configuration data that is contained in the oldimage file with the configuration data that is contained in the newimage file. To use the scsnapshot tool to upgrade configuration data, you do not need specific RBAC authorization. EXAMPLES
Example 1 To Generate a Shell Script That Retrieves Configuration Data for Resources Groups, Resource Types, and Resources The script that is generated in this example is called scriptfile.sh. example% scsnapshot -s scriptfile.sh Example 2 To Generate a Shell Script That Retrieves Configuration Data and Stores an Image File The script that is generated in this example is called scriptfile.sh. The configuration data is stored in an image file called imagefile. example% scsnapshot -s scriptfile.sh -o imagefile Example 3 To Generate a Shell Script That Upgrades Configuration Data on One Cluster With Configuration Data From Another Cluster This example creates a script that upgrades the configuration data on cluster1 to match the configuration data on cluster2. The configura- tion data for cluster1 is in a file called imagefile1, and the configuration data for cluster2 is in a file called imagefile2. The name of a shell script is not specified, so the generated script is written to the standard output. example% scsnapshot imagefile1 imagefile2 EXIT STATUS
The following exit status codes are returned: 0 The command completed successfully. nonzero An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWsczu | +-----------------------------+-----------------------------+ |Interface Stability |Evolving | +-----------------------------+-----------------------------+ SEE ALSO
Intro(1CL), attributes(5), clconfiguration(5CL), rbac(5), rg_properties(5), rt_properties(5), r_properties(5) Sun Cluster 3.2 22 Jun 2006 scsnapshot(1M)