07-01-2009
RE: KSH - Sourced file location
Not really much help. The link tried to provide workarounds rather than answering the question. There are times when inside the script, it doesn't know what directory it is in. Seems like a $0 equivalent should be available for a sourced file.
10 More Discussions You Might Find Interesting
1. OS X (Apple)
Hi:
So my current Python (2.52) rig is not working as intended. "echo $PATH" in bash gives me 'X'" that's not what i want, so i need to change my path. To do that, there appeared to be four choices (all in my ~/ directory--note: I'm root, it's my Mac, but i'm in a user account):
.profile... (2 Replies)
Discussion started by: Alex_Land
2 Replies
2. Shell Programming and Scripting
Hello,
I have written a script (say chld.sh). its structure is as follows:
------------------------
#!/bin/sh
usage()
{
echo "chld.sh <param1> <param2>"
exit 0
}
chk_param_1()
{
case $param1 in
c) export PATH=$PATH:/home_a/bin/execs;;
d) export... (2 Replies)
Discussion started by: angad.makkar
2 Replies
3. Shell Programming and Scripting
Hi Everyone,
I have 1.txt
here
a
b
c' funny"yes";
d
e
The finally output is:
here
a
b
c
d
e' funny"yes"; (1 Reply)
Discussion started by: jimmy_y
1 Replies
4. Shell Programming and Scripting
This is a very simple problem, I am wondering why I can find no answer anywhere...
I have a script that can be run either sourced or not. This script has some place where it needs to quit execution (e.g., when an error is found)
If I "exit", the sourced call would exit the parent shell, but... (7 Replies)
Discussion started by: MadMage
7 Replies
5. Shell Programming and Scripting
Hello,
I am trying to install Env::Sourced and i get the following error.
sh: source: not found
sh: include.sh: not found
Unable to determine your shells source program, typically 'source' or '.'
How can i overcome this?
Best Regards,
Christos (3 Replies)
Discussion started by: chriss_58
3 Replies
6. Shell Programming and Scripting
Hi,
I am logging to a linux server through a user "user1" in /home directory.
There is a script in a directory in 'root' for which all permissions are available including the directory. This script when executed creates a file in the directory.
When the script is added to crontab, on... (1 Reply)
Discussion started by: archana.n
1 Replies
7. Shell Programming and Scripting
I have file file1.txt in location 'loc1'. Now i want a copy of this file in location 'loc2' with a new file called test.txt.
Please help me how to do this in shell script. (1 Reply)
Discussion started by: vel4ever
1 Replies
8. Shell Programming and Scripting
Hi
This is my third past and very impressed with previous post replies
Hoping the same for below query
How to find a existing file location and directory location in solaris box (1 Reply)
Discussion started by: buzzme
1 Replies
9. Shell Programming and Scripting
I've been asked if I can write a "quick" little ksh script that will do the following:
java java_class_file /dir/input_file.xml /dir/output_file.xml
I'm a complete newbie with ksh so any help would be appreciated.
This is on AIX and java is found in
/usr/java5/jre/bin/java (4 Replies)
Discussion started by: newbie_ksh
4 Replies
10. Shell Programming and Scripting
Hello there wonderful people,
I am running on Solaris 10 and with the following ksh version:
strings /bin/ksh | grep Version | tail -2
@(#)Version M-11/16/88i
Suppose I want to copy files that end in _v2 from underneath /dir1/dir2/save directory to /dir1/dir2. Basically, what I’m... (12 Replies)
Discussion started by: ejianu
12 Replies
LEARN ABOUT DEBIAN
soelim
SOELIM(1) General Commands Manual SOELIM(1)
NAME
soelim - interpret .so requests in groff input
SYNOPSIS
soelim [-Crtv] [-I dir] [files ...]
It is possible to have whitespace between the -I command line option and its parameter.
DESCRIPTION
soelim reads files and replaces lines of the form
.so file
by the contents of file. It is useful if files included with .so need to be preprocessed. Normally, soelim should be invoked with the -s
option of groff.
To embed `' in the file name, write `\' or `e'. To embed a space, write ` '. Any other escape sequence in file makes soelim ignore
the whole line.
Note that there must be no whitespace between the leading dot and the two characters `s' and `o'. Otherwise, only groff interprets the .so
request (and soelim ignores it).
OPTIONS
-C Recognize .so even when followed by a character other than space or newline.
-Idir This option may be used to add a directory to the search path for files (both those on the command line and those named in .so
requests). The search path is initialized with the current directory. This option may be specified more than once; the directories
are then searched in the order specified (but before the current directory). If you want to make the current directory be read
before other directories, add -I. at the appropriate place.
No directory search is performed for files with an absolute file name.
-r Do not add .lf requests (for general use, with non-groff files).
-t Don't emit .lf requests but TeX comment lines (starting with `%') giving the current file and line number.
-v Print the version number.
USAGE
The normal processing sequence of groff is this:
input sourced
file file
| |
v v
preprocessor -> troff -> postprocessor
|
v
output
file
That is, files sourced with .so are normally read only by troff (the actual formatter). soelim is not required for troff to source files.
If a file to be sourced should also be preprocessed, it must already be read before the input file passes through the preprocessor. This
is handled by soelim:
input
file
|
v
soelim -> preprocessor -> troff -> postprocessor
^ |
| v
sourced output
file file
SEE ALSO
groff(1)
Groff Version 1.21 31 December 2010 SOELIM(1)