It is currently Thu, 20 Jan 2022 04:29:57 GMT



 
Author Message
 Bourne shell equivilant of "source"
In <468d0k$...@vixen.cso.uiuc.edu>, "Kenneth L. Hamer" <k-ha...@uiuc.edu> writes:

The Bourne Shell equivalent of "source" is "."

#!/bin/sh
 another.sh

thats dot-space-another.sh

-------------------------------------------------------------------
Dana French                                     Internet: dfre...@aig.com
Applied Intelligence Group                      Voice:  405-341-7700
501 East 15th Street, Suite 202                 FAX:    405-341-8898
Edmond, OK  73013



 Tue, 07 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"

Simply '.' dot

eg

 $ .  filename



 Tue, 07 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"
Kenneth L. Hamer (k-ha...@uiuc.edu) wrote:
:>Hello:

:>I am trying to get a Bourne shell script to "source" another file, and execute
:>the commands contained in that file.  Alas, sh does not have a source command,
:>so I was wondering if anyone knew of some hackery which could accomplish the
:>same trick.

:>I am thinking of something along the lines of "eval `foo`", where foo is a
:>script that echoes the commands I want executed. However, my implementation fo
:>this does not seem to work.  Sadly, sh is a necessity here.

:>Any ideas?

:>Thanks, Ken.

#!/bin/sh
# some commands
. foo
# some other commands, having sourced file "foo".
# Please note that it's worth giving the full path of foo, as otherwise
# finding it depends on the $PATH of the user.

        Steve.

--
                         Steve G Parker
4th Year Computer Science BSc (Hons), University of Hertfordshire, UK
----------------------------------------------------------------------
Computer Architecture, Operating Systems, Computer Networks, Practical
         Uses of Network Technology, User Centred Design



 Tue, 07 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"
:> I am trying to get a Bourne shell script to "source" another file, and
:> the commands contained in that file.  Alas, sh does not have a source
Simple:

      . filename_with_your_sh_commands_in

exactly like csh's 'source'

:> Sadly, sh is a necessity here.
Surely this is a reason for rejoicing, not sadness.

--
   ;~~~~~:        ,'*-.,_,.-*'   Malcolm.Mur...@bris.ac.uk    *-.,_,.-*'.
  / /| |\ \ alc  /       http://kingdom.maths.bris.ac.uk/~MurphyM/       \
 / / | | \ \    :  Watch what you say -- they'll be calling you a radical ;
(_(  |_|  )_)    `-'*-.,_,.-*'`~'`*-.,_,.-*'`~'`*-.,_,.-*'`~'`*-.,_,.-*'-'



 Tue, 07 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"
In article <468d0k$...@vixen.cso.uiuc.edu>,
   "Kenneth L. Hamer" <k-ha...@uiuc.edu> wrote:

#!/bin/bash
echo "about to call file2"
 file2
echo "done file2"

Try that and see if it's what you want. I didn't quie follow your 2nd
paragraph.

--
Our continuing mission: To seek out knowledge of C, to explore strange
UNIX commands, and to boldly code where no one has man page 4



 Wed, 08 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"

You miss the dot (.). Just put
 file2
into your script, and you get your `source' (see also man pages of sh).

Jo"rg
--
-------------------------------------------------------------------------------
Jo"rg Burmeister
GMD FOKUS Berlin
Forschungszentrum Informationstechnik GmbH
Research Institute for Open Communication Systems

                  | Internet: burmeis...@fokus.gmd.de
Hardenbergplatz 2 | X.400:    S=burmeister;OU=fokus;OU=berlin;P=gmd;A=d400;C=de
D - 10623 Berlin  | phone:    +49 30 25499 241
Germany           | fax:      +49 30 25499 202
                  | WWW:      http://www.fokus.gmd.de/htbin/info/burmeister
------------------+------------------------------------------------------------



 Sun, 12 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"
In article <46lgnu$...@stern.fokus.gmd.de>,
: nick.k...@es.co.nz (Nick Kean) wrote:
: >In article <468d0k$...@vixen.cso.uiuc.edu>,
: >   "Kenneth L. Hamer" <k-ha...@uiuc.edu> wrote:
: >>I am trying to get a Bourne shell script to "source" another file,
: >>and execute the commands contained in that file.  
: >
: >#!/bin/bash
: >echo "about to call file2"
: > file2
: >echo "done file2"
:
: You miss the dot (.). Just put
:  file2
: into your script, and you get your `source' (see also man pages of sh).

You missed the dot too.

Actually, you didn't--some broken software along the way (C-News, say,
or INN) uses sentinel values to indicate the end of input, and the
sentinel value happens to be a dot at the start of a line.
Unfortunately, the brokenness is compounded by the software's refusal to
accept anything with a dot (possibly followed by whitespace) as the
first thing on a line, and, worse, it EDITS your post--silently,
mind--to fix this problem.  And in an information-LOSING way.

Argh.

This has been yet another rant.

--Dave



 Sun, 12 Apr 1998 03:00:00 GMT   
 Bourne shell equivilant of "source"

Hi
Does anyone have some good examples of Perl scripts using sockets?

Thanks
Tobias Svennebring

--

Mvh Tobias Svennebring

----------------------------------------------------------------------
Tobias Svennebring      d92-...@nada.kth.se
Hugins v?g 10           08 / 718 18 53



 Sun, 26 Apr 1998 03:00:00 GMT   
 
   [ 8 post ] 

Similar Threads

1. Bourne shell: "no stack space" problem

2. Bourne shell "trip test"?

3. Bourne shell "read line"

4. Q about Bourne shell "read" command

5. Bourne Shell Script to "C" Converter

6. "unset" variables under ultrix bourne shell

7. "Free", "Open Source", and Philosophies of Software Ownership (long)

8. "Source Route Failed", "LOGIN FAIL..", "Malformed response", and "Lame server" messages in /var/log


 
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group.
Designed by ST Software