|
|
how to source a file in a script
Hi,
First, can someone explain what it means to "source a file"? I'm new to an
application on a solaris server that one of the steps to compile oracle
forms is
to source a file via the command: . /path/filetosource.sh
Second, I want to incorporate this "sourcing" into a script file I can run
so I
can make it easier to compile the oracle forms. How can I do it? If I put
.. /path/filetosource.sh in the script, it doesn't seem to do it.
Thanks,
Tim
|
|
0
|
|
|
|
Reply
|
web
|
9/10/2003 3:51:09 PM |
|
"web guy" <web-guy01@comcast.net> writes:
> First, can someone explain what it means to "source a file"? I'm new to an
> application on a solaris server that one of the steps to compile oracle
> forms is
> to source a file via the command: . /path/filetosource.sh
When the shell sources a file, it executes each line of the file as if
it was typed on the command line, or inserted into the script it's
currently processing. It is commonly used to set environment
variables.
> Second, I want to incorporate this "sourcing" into a script file I
> can run so I can make it easier to compile the oracle forms. How
> can I do it? If I put . /path/filetosource.sh in the script, it
> doesn't seem to do it.
That should work. Try it out with some simple test cases.
--
M�ns Rullg�rd
mru@users.sf.net
|
|
0
|
|
|
|
Reply
|
mru
|
9/10/2003 4:02:28 PM
|
|
M�ns Rullg�rd wrote:
> "web guy" <web-guy01@comcast.net> writes:
>
>
>>First, can someone explain what it means to "source a file"? I'm new to an
>>application on a solaris server that one of the steps to compile oracle
>>forms is
>>to source a file via the command: . /path/filetosource.sh
>
>
> When the shell sources a file, it executes each line of the file as if
> it was typed on the command line, or inserted into the script it's
> currently processing. It is commonly used to set environment
> variables.
>
>
>>Second, I want to incorporate this "sourcing" into a script file I
>>can run so I can make it easier to compile the oracle forms. How
>>can I do it? If I put . /path/filetosource.sh in the script, it
>>doesn't seem to do it.
>
>
> That should work. Try it out with some simple test cases.
>
If you put a source into a script, it will not affect the
parent shell unless the script itself is sourced. Otherwise,
a script is run in a sub-shell and all source information is lost
when the sub-shell exits.
--
Fletcher Glenn
|
|
0
|
|
|
|
Reply
|
Fletcher
|
9/10/2003 4:32:24 PM
|
|
Thank you both for the info. The second explanation about
the subshell is why I didn't think it was working in the script.
Thanks.
"Fletcher Glenn" <fletcher@removethisfoglight.com> wrote in message
news:3F5F5224.7050104@removethisfoglight.com...
>
>
> M�ns Rullg�rd wrote:
> > "web guy" <web-guy01@comcast.net> writes:
> >
> >
> >>First, can someone explain what it means to "source a file"? I'm new to
an
> >>application on a solaris server that one of the steps to compile oracle
> >>forms is
> >>to source a file via the command: . /path/filetosource.sh
> >
> >
> > When the shell sources a file, it executes each line of the file as if
> > it was typed on the command line, or inserted into the script it's
> > currently processing. It is commonly used to set environment
> > variables.
> >
> >
> >>Second, I want to incorporate this "sourcing" into a script file I
> >>can run so I can make it easier to compile the oracle forms. How
> >>can I do it? If I put . /path/filetosource.sh in the script, it
> >>doesn't seem to do it.
> >
> >
> > That should work. Try it out with some simple test cases.
> >
>
> If you put a source into a script, it will not affect the
> parent shell unless the script itself is sourced. Otherwise,
> a script is run in a sub-shell and all source information is lost
> when the sub-shell exits.
>
> --
>
> Fletcher Glenn
>
|
|
0
|
|
|
|
Reply
|
web
|
9/10/2003 7:10:41 PM
|
|
|
3 Replies
443 Views
(page loaded in 0.047 seconds)
Similiar Articles: how to source a file in a script - comp.unix.programmerHi, First, can someone explain what it means to "source a file"? I'm new to an application on a solaris server that one of the steps to compile orac... How to invoke autolisp routine and script file to one common ...FREE AutoLisp routines for download - comp.cad.solidworks ..... how to source a file in a script - comp.unix.programmer Free break up large file for to download ... how to use script file in cmd line - comp.lang.awkhow to source a file in a script - comp.unix.programmer using PDFTK in batch mode? - comp.text.pdf Hi, I'd like to create a spreadsheet of source PDFs, page ranges and ... Hiding shell script source code??? - comp.unix.programmer ...how to source a file in a script - comp.unix.programmer Otherwise, > a script is run in a sub-shell and all source information is lost > when the ... to/log_file I want to ... Convert .xls file to .csv file in unix script - comp.unix.shell ...how to source a file in a script - comp.unix.programmer Convert .xls file to .csv file in unix script - comp.unix.shell ... how to source a file in a script - comp.unix ... How to set DISPLAY env. in script. - comp.sys.sun.adminSet it in your .profile, or "source" the script... don't execute it. When you run a ... but ... instead of set. to debug, use env(1 ... how to source a file in a script ... Concurrent Updates of the Same File by 2 Instances of the Same ...Concurrent Updates of the Same File by 2 Instances of the Same ... does rsync lock the destination file ... how to source a file in a script - comp.unix.programmer Script ... DBX script to print stack trace seen at breakpoint - comp.unix ...how to source a file in a script - comp.unix.programmer DBX script to print stack trace seen at breakpoint - comp.unix ... I source the script inside DBX and call the ... Break up a Large Source File - comp.lang.c++.moderatedHow to invoke autolisp routine and script file to one common ... how to source a file in a script - comp.unix.programmer Break up a Large Source File - comp.lang.c++ ... Copying one file to different destinations. - comp.unix.programmer ...It doesn't copy one file to multiple destinations. I want ... wanted to read the disk twice, I would make a bash-script. How can this be solved? I'm reading the source of ... Shell Script to read source file and copy it to target fileExplains how to copy source file to destination using a shell script and cp command. How to: Open a Resource Script File in Text Format... be times when you want to view the contents of your project's resource script (.rc) file ... From the shortcut menu, choose Open with..., then select Source Code (Text ... 7/23/2012 6:42:42 AM
|
|
|
|
|
|
|
|
|