Sponsored Content
Top Forums Shell Programming and Scripting Syntax Error in Unix Shell Script Post 302656629 by Mary James on Friday 15th of June 2012 05:15:34 AM
Old 06-15-2012
Syntax Error in Unix Shell Script

I am trying to run a unix script in my home directory.Snippet below

Code:
 
echo "`date '+%Y%m%d_%H%M%S'` Getting ProductList.dat"
if ( -f $DIR/ProductList.dat) then
 cp  $DIR/ProductList.dat MigratedProductList.dat
else
 echo "`date '+%Y%m%d_%H%M%S'`ProductList.dat does not exist; Processing Terminated"
 echo "***************************************************************************"
 exit 1
endif

It gives me error like
Code:
 
1. syntax error at line 31 : `else' unmatched
2. -f:  not found
3.  /ProductList.dat:  not found(ProductList.dat  is already present in the specified location)

My entire script runs fine in another user account.Will there be any difference for the command and syntax if we run in our home directory

Please help
 

10 More Discussions You Might Find Interesting

1. 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

2. Shell Programming and Scripting

Help on shell script : syntax error at line 62: `end of file' unexpected

Hi All, I have written a korn script (code pasted below). It is giving the error while debugging "new.sh: syntax error at line 62: `end of file' unexpected". I have re-written the whole code in VI and explored all help related to this error on this Unix forum and tried it. Somehow, I could... (7 Replies)
Discussion started by: schandrakar1
7 Replies

3. Shell Programming and Scripting

AWK syntax /bailing script error when executing in UNIX

Hi I am trying to execute the following awk script in unix but getting the following error awk: syntax error near line 1 awk: bailing out near line 1 for i in `cat search` do grep -i -l $i *.sas | awk -v token=$i '{print token "\t" $0}' done Please let me know what could be the... (4 Replies)
Discussion started by: nandugo1
4 Replies

4. 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

5. Shell Programming and Scripting

syntax error in shell script

I am creating a shell script. In which, I need to get server name and server IP. I used this command in script. servername=`cat /etc/hosts|grep `eval hostname`|awk '{print $2}'` however, when execute script or put set -x to debug, it return: line 13: syntax error at line 13: `|' unexpected... (4 Replies)
Discussion started by: duke0001
4 Replies

6. Shell Programming and Scripting

Compare two initoras shell script syntax error

Hi All, I am executing the below shell script to compare two initoras files which is ending up in syntax error as below: -bash-3.2$ cat compare_two_initoras.sh #!/bin/bash file1=$1 file2=$2 for parameter in `cat $file1 | grep = | awk '{print $1}' | grep -v '#'` do value1=`grep... (4 Replies)
Discussion started by: a1_win
4 Replies

7. HP-UX

HP-UX: Shell Script giving " 0^J30: Syntax error"

Hi All, We are getting a very unique error while running a shell script on HP-UX box. Can somebody help in this regards? The shell script is working fine on linux/solaris box. Error: ++++++++++++++++++++++++ $/test.sh ./test.sh: 0^J30: Syntax error $ ++++++++++++++++++++++++ TIA.... (16 Replies)
Discussion started by: vai_sh
16 Replies

8. UNIX for Beginners Questions & Answers

Syntax error C shell

Hello, I have a newbe syntax error but I cant find it syntax error: unexpected end of file #!/bin/csh # pe request #$ -pe mpi_16 32 #### 16 core : 'mpi_16 16' || 24 core : 'mpi_24 24 ' # our Job name #$ -N test2MD #$ -S /bin/sh (1 Reply)
Discussion started by: dulceC
1 Replies

9. Shell Programming and Scripting

Isql syntax error in UNIX script

Hello Everyone, Coming again for your help to solve the below error: In a script, i had created a temp table (Temp_table) and loaded the data in it using bcp command (performed successfully) and I wanted to move it to the preferred table (called Main_table) for further use. hence I have added... (1 Reply)
Discussion started by: Suresh
1 Replies

10. UNIX for Advanced & Expert Users

Isql and If Exist syntax error in UNIX script

Hello Everyone, Coming again for your help to solve the below error: In a script, i had created a temp table (Temp_table) and loaded the data in it using bcp command (performed successfully) and I wanted to move it to the preferred table (called Main_table) for further use. hence I have added... (7 Replies)
Discussion started by: Suresh
7 Replies
Padre::Plugin::Snippet(3pm)				User Contributed Perl Documentation			       Padre::Plugin::Snippet(3pm)

NAME
Padre::Plugin::Snippet - TextMate-like snippets for Padre SYNOPSIS
cpan Padre::Plugin::Snippet Then use it via Padre, The Perl IDE. DESCRIPTION
Once you enable this Plugin under Padre, you'll get TextMate-style TAB triggered snippets for the following: Perl Moose Mouse MooseX::Declare Example For those who don't who this Text mate bloke is, just try to type in Padre something like: for<tab> if<tab> ife<tab> cfor<tab> While editing the generated construct, you can type again <TAB>. Your cursor will be moved to the next point needing some attention in the generated construct. You can check the available keyword in the yaml files (perl.yml...) shipped with this module. BUGS
Please report any bugs or feature requests to "bug-padre-plugin-snippet at rt.cpan.org", or through the web interface at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Padre-Plugin-Snippet>. I will be notified, and then you'll automatically be notified of progress on your bug as I make changes. SUPPORT
You can find documentation for this module with the perldoc command. perldoc Padre::Plugin::Snippet You can also look for information at: o RT: CPAN's request tracker http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet <http://rt.cpan.org/NoAuth/Bugs.html?Dist=Padre-Plugin-Snippet> o AnnoCPAN: Annotated CPAN documentation http://annocpan.org/dist/Padre-Plugin-Snippet <http://annocpan.org/dist/Padre-Plugin-Snippet> o CPAN Ratings http://cpanratings.perl.org/d/Padre-Plugin-Snippet <http://cpanratings.perl.org/d/Padre-Plugin-Snippet> o Search CPAN http://search.cpan.org/dist/Padre-Plugin-Snippet/ <http://search.cpan.org/dist/Padre-Plugin-Snippet/> SEE ALSO
Padre AUTHORS
Ahmad M. Zawawi <ahmad.zawawi@gmail.com> CONTRIBUTORS
Adam Kennedy <adamk@cpan.org> Kevin Dawson <bowtie@cpan.org> COPYRIGHT AND LICENSE
This software is copyright (c) 2012 by Ahmad M. Zawawi This is free software; you can redistribute it and/or modify it under the same terms as the Perl 5 programming language system itself. perl v5.14.2 2012-03-27 Padre::Plugin::Snippet(3pm)
All times are GMT -4. The time now is 06:49 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy