01-14-2008
how to source a csh file from ksh
I have some common parameters established by setenv in a csh file.
I can "source" this file ( " source /path/aaa.csh " ) from inside a csh file and then access those parameters from the calling script.
I wish to source the same csh file from inside a ksh script; but the ksh script processor refuses to recognize the #!/bin/csh statement in the csh file; and therefore refuses to process a setenv; it expects an export statement.
(I used " . /path/aaa.csh " in the ksh script)
I don't want to create a ksh version of this parameter file. Is there a way to source a csh file from a ksh calling routine?
Thank for any insight and guidance you can provide.
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
This is shell programming assignment.
It needs to create a file called .std_dbrc contains
STD_DBROOT=${HOME}/class/2031/Assgn3/STD_DB
(which includes all my simple database files)
and I am gonna use this .std_dbrc in my script file (read the data from the database files)
like this: .... (3 Replies)
Discussion started by: ccwq
3 Replies
2. Shell Programming and Scripting
# type source
source is a shell builtin
What is the kshell alternative of source? I want to run a ksh script in the parent shell rather than creating a child shell. (1 Reply)
Discussion started by: proactiveaditya
1 Replies
3. Shell Programming and Scripting
Hi experts,Please help me for the below requirement. i have a source file.(lets say contains 50 columns). I am extarcting five columns from the source file by using pattern file. for example input file:--------a,b,c,d,"a,g","v b",s,koutputfile=======a,"a,g","v b",s,kThanks in advance subhendu (2 Replies)
Discussion started by: subhendu81
2 Replies
4. Shell Programming and Scripting
hi all,
Please help me with rsync.
I configured rsync to preserve timestamps using the -a option.
When i renamed fileA to fileB on source machine I have to copies at the backup server.
The aim is to keep the most recent file.
fileA & fileB has same contents.
When i renamed fileB to... (2 Replies)
Discussion started by: coolatt
2 Replies
5. Shell Programming and Scripting
Hi
I am new to this Scripting process and would like to know How can i write a ksh script that will call other ksh scripts and write the output to a file and/or email.
For example
-------
Script ABC
-------
a.ksh
b.ksh
c.ksh
I need to call all three scripts execute them and... (2 Replies)
Discussion started by: pacifican
2 Replies
6. Shell Programming and Scripting
Hi all,
I have a requirement to create a "superset" file out of a number of different sources with some different and some same columns.
We intend to have a manually updateable SuperSetCols.csv which would look like
"ColA","ColB","ColC","ColD","ColE","ColF","ColG"
so someday we may add... (3 Replies)
Discussion started by: Leedor
3 Replies
7. Programming
I need to
"Ensure that when you download libchat.a from the VLE you have copied it to the same folder on ius as your source files. You then refer to the library (and the libraries it needs) with:
gcc -o outputfile sourcefile.c -L. -lchat -lsocket -lnsl"
But I have no idea what this means! (I... (2 Replies)
Discussion started by: fakuse
2 Replies
8. Shell Programming and Scripting
Hi all,
I'm pretty new to Shell scripting and I need some help to split a source text file into multiple files. The source has a row with pattern where the file needs to be split, and the pattern row also contains the file name of the destination for that specific piece. Here is an example:
... (2 Replies)
Discussion started by: cul8er
2 Replies
9. UNIX for Dummies Questions & Answers
Hello,
I have to write a script to compare the sum of the amount fields in a source file and the amount field in another file.
details are:
based on the name of the source file (say SALES as an example), a file already available in a path will be grabbed (say SALES_ParmFile) and this file... (4 Replies)
Discussion started by: vijaylak
4 Replies
LEARN ABOUT OPENDARWIN
source
source(n) Tcl Built-In Commands source(n)
__________________________________________________________________________________________________________________________________________________
NAME
source - Evaluate a file or resource as a Tcl script
SYNOPSIS
source fileName
source -rsrc resourceName ?fileName?
source -rsrcid resourceId ?fileName?
_________________________________________________________________
DESCRIPTION
This command takes the contents of the specified file or resource and passes it to the Tcl interpreter as a text script. The return value
from source is the return value of the last command executed in the script. If an error occurs in evaluating the contents of the script
then the source command will return that error. If a return command is invoked from within the script then the remainder of the file will
be skipped and the source command will return normally with the result from the return command.
The end-of-file character for files is '32' (^Z) for all platforms. The source command will read files up to this character. This |
restriction does not exist for the read or gets commands, allowing for files containing code and data segments (scripted documents). If |
you require a ``^Z'' in code for string comparison, you can use `` 32'' or ``u001a'', which will be safely substituted by the Tcl inter- |
preter into ``^Z''.
The -rsrc and -rsrcid forms of this command are only available on Macintosh computers. These versions of the command allow you to source a
script from a TEXT resource. You may specify what TEXT resource to source by either name or id. By default Tcl searches all open resource
files, which include the current application and any loaded C extensions. Alternatively, you may specify the fileName where the TEXT
resource can be found.
SEE ALSO
file(n), cd(n)
KEYWORDS
file, script
Tcl source(n)