Sponsored Content
Full Discussion: Problem with csh script
Top Forums Shell Programming and Scripting Problem with csh script Post 302169149 by rahulrathod on Wednesday 20th of February 2008 12:27:02 PM
Old 02-20-2008
Problem with csh script

Hi All,

I have the following script.

Code:
#!/bin/csh
#
# createDATfile.sh
#


cd /export/home/fastserv/bin
source /export/home/fastserv/bin/dbenv.sh
echo `date` >> /export/home/fastserv/bin/log.txt
echo "%INF% Starting send of current FASTSERVICE batch" >> /export/home/fastserv/bin/log.txt
sqlplus fastsrv/fastsrv << EOF
set serveroutput on
begin
        create_fastsrv_file;
end;
.
/
EOF
if (-e /export/home/fastserv/bin/NORECORDS) then
        echo "%INF% No records created" >> /export/home/fastserv/bin/log.txt
        rm -f /export/home/fastserv/bin/NORECORDS
endif
#
# Now check do email
#
echo "%INF% Checking for error mail file" >> /export/home/fastserv/bin/log.txt
if (-e /export/home/fastserv/bin/mailFASTSRVerror.sh) then
        cp /export/home/fastserv/bin/mailFASTSRVerror.sh send.sh
        chmod 744 send.sh
        rm -f mailFASTSRVerror.sh
        source /export/home/fastserv/bin/send.sh
        rm send.sh
        echo "%INF% Sent error mail message - previous batch not picked up" >> /export/home/fastserv/bin/log.txt
endif
echo "%INF% Script completed" >> /export/home/fastserv/bin/log.txt
echo `date` >> /export/home/fastserv/bin/log.txt


When I run the script as follows, I get the output as below.

Code:
$sh -x createFASTSRVfile.sh
+ cd /export/home/fastserv/bin
+ source /export/home/fastserv/bin/dbenv.sh
createFASTSRVfile.sh: source: not found
+ date
+ echo Wed Feb 20 17:26:36 GMT 2008
+ echo %INF% Starting send of current FASTSERVICE batch
+ sqlplus fastsrv/fastsrv
set serveroutput on
begin
        create_fastsrv_file;
end;
.
/

SQL*Plus: Release 10.1.0.3.0 - Production on Wed Feb 20 17:26:36 2008

Copyright (c) 1982, 2004, Oracle.  All rights reserved.


Connected to:
Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options

SQL> SQL>   2    3    4  SQL>
PL/SQL procedure successfully completed.

SQL> Disconnected from Oracle Database 10g Enterprise Edition Release 10.1.0.3.0 - 64bit Production
With the Partitioning, OLAP and Data Mining options
createFASTSRVfile.sh: syntax error at line 38: `end of file' unexpected

Can anyone please advise what is the problem in my script?

Thanks,
Rahul.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

cron job problem with csh script

I've written a csh shell script to number each line of a file. Firstly, the program count the number of the file and create a file with number at the front. Then, combine the file together. when i call the program manually, it works.However, when i set it in the cronjob, the output always leaves... (3 Replies)
Discussion started by: fung_donald
3 Replies

2. Shell Programming and Scripting

Problem accessing csh ?? (Newbie)

Hi All, Just recently started using a program in Unix for a client. I was sent a script to use but for some reason it's not working. The person who created the script first suggested I may need to edit the first line of the script so that it has the correct path for the csh file: #!/bin/csh -f... (3 Replies)
Discussion started by: gmalt
3 Replies

3. Shell Programming and Scripting

csh problem with while

Hello this my first post, so i hope you help me echo -n "Choose which square you want to hit of PL2 grid " set pl2_square = $< set i = 1 while ($i <= 6) if ($pl2_square == $pl2_ships) then $pl2_ships = x echo "" echo "" echo "PL1 has hitted a square of PL2" echo... (5 Replies)
Discussion started by: amaj1407
5 Replies

4. Shell Programming and Scripting

csh failing to call an 2 embedded csh script

I have an extraordinary problem with a csh script.....(feel free to berate the use of this but I'm modifying an existing bunch of them) Anyway, I have a master csh script which in turn calls a second csh script. This second csh script is below. Within this second script are two compiled C++... (1 Reply)
Discussion started by: pollsizer
1 Replies

5. Shell Programming and Scripting

${name${i}} problem in CSH

Hello all, I tried the following commands in the cshell, but failed. ~Cshell %set i=2 ~Cshell %set fields${i}= ( ad dd dd ) ~Cshell %echo $fields${i} fields: Undefined variable. ~Cshell %echo ${fields${i}} Missing }. And i can see the $fields2 is already set as a local variable... (0 Replies)
Discussion started by: tpltp
0 Replies

6. Shell Programming and Scripting

Problem with endsw in csh

I am getting an error and can't figure out the problem breaksw: endsw not found. Problem has been solved now (0 Replies)
Discussion started by: kristinu
0 Replies

7. Shell Programming and Scripting

Execution problem with csh script

Hi All, I have a small issue with my csh script which I am using to FTP a file. What I know is...there are two commands to execute script.. 'sh <file>' & '\<file>'. When I execute my script with command 'sh <file>', it gives me syntax error while it runs successfully with command '\<file>'. I am... (3 Replies)
Discussion started by: ndd
3 Replies

8. Shell Programming and Scripting

CSH missing - problem

Hi all, i need help with this code set login = (`cut -d ":" -f1 /etc/passwd.2001`) set group = (`cut -d ":" -f4 /etc/passwd.2001`) set name = (`cut -d ":" -f5 /etc/passwd.2001 | cut -d ":" -f1`) set i = 1 while ($#login > 0) set pom = `last $login | wc -l` if ($pom < 3) then... (1 Reply)
Discussion started by: Casualty
1 Replies

9. UNIX for Dummies Questions & Answers

Problem with simple csh scripting

I found my answer... (2 Replies)
Discussion started by: sjung9442
2 Replies

10. Shell Programming and Scripting

awk execution problem in csh

This has no error awk '($8==150) && ($4>=11.001 && $4 <= 12) && ($5>=91.001 && $5<=92){print}' OFS="\t" file following are unable to run in csh this is giving error awk: line 1: syntax error at or near not even working in terminal awk '($'$gr'=='$grn') && ($'$ll'>='$Y' && $'$ll' <= '$Ym')... (1 Reply)
Discussion started by: nex_asp
1 Replies
pam_xauth(8)						   System Administrator's Manual					      pam_xauth(8)

NAME
pam_xauth - forward xauth keys between users SYNOPSIS
session optional /lib/security/pam_xauth.so arguments DESCRIPTION
pam_xauth.so is designed to forward xauth keys (sometimes referred to as "cookies") between users. Without pam_xauth, when xauth is enabled and a user uses the su command to assume another user's priviledges, that user is no longer able to access the original user's X display because the new user does not have the key needed to access the display. pam_xauth solves the problem by forwarding the key from the user running su (the source user) to the user whose identity the source user is assuming (the target user) when the session is created, and destroying the key when the session is torn down. This means, for example, that when you run su from an xterm sesssion, you will be able to run X programs without explicitly dealing with the xauth command or ~/.Xauthority files. pam_xauth will only forward keys if xauth can list a key connected to the $DISPLAY environment variable. Primitive access control is provided by ~/.xauth/export in the invoking user's home directory and ~/.xauth/import in the target user's home directory. If a user has a ~/.xauth/import file, the user will only receive cookies from users listed in the file. If there is no ~/.xauth/import file, the user will accept cookies from any other user. If a user has a .xauth/export file, the user will only forward cookies to users listed in the file. If there is no ~/.xauth/export file, and the invoking user is not root, the user will forward cookies to any other user. If there is no ~/.xauth/export file, and the invoking user is root, the user will not forward cookies to other users. Both the import and export files support wildcards (such as *). Both the import and export files can be empty, signifying that no users are allowed. ARGUMENTS
debug Turns on debugging messages sent to syslog. xauthpath=/usr/X11R6/bin/xauth Specify the path the xauth program (the default is /usr/X11R6/bin/xauth). IMPLEMENTATION DETAILS
pam_xauth will work only if it is used from a setuid application in which the getuid() call returns the id of the user running the applica- tion, and for which PAM can supply the name of the account that the user is attempting to assume. The typical application of this type is su. The application must call both pam_open_session() and pam_close_session() with the ruid set to the uid of the calling user and the euid set to root, and must have provided as the PAM_USER item the name of the target user. pam_xauth calls xauth as the source user to extract the key for $DISPLAY, then calls xauth as the target user to merge the key into the a temporary database and later remove the database. pam_xauth cannot be told not to remove the keys when the session is closed. SEE ALSO
/usr/share/doc/pam*/html/index.html FILES
~/.xauth/import ~/.xauth/export BUGS
Let's hope not, but if you find any, please report them via the "Bug Track" link at http://bugzilla.redhat.com/bugzilla/ AUTHOR
Nalin Dahyabhai <nalin@redhat.com>, based on original version by Michael K. Johnson <johnsonm@redhat.com> Red Hat Linux 2001/9/27 pam_xauth(8)
All times are GMT -4. The time now is 08:10 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy