Automatically determining directory path for scripts and programs
I have some C++ code in the following directory structure
My directory structure of my data is
Basically I go to one of my data directories
by performing
and run the scripts from the data directory using
The thing is that my bash script raytrac.bash needs to call other scripts and programs as well.
For example, from within my bash script, raytrac.bash, I would need to call
So I am wondering how to automatically set up the paths I need for the bash, awk and prog directories, without having to hardwire the paths. This is important as I can always run my tests on whatever machine I want without having to change the paths every time.
Basically by knowing where my data and my bash script is, the base script will take care of figuring out the directory paths for the bash, awk and prog directories.
I have an issue while determing whether given string is unix path or not
There is a text file which is normally a report in that at some place
we have unix path as shown below
/opt/smart/dev/eur/sources/sqr and
not unix path as shown below
Threshold Year/Month/Ref/ActLine/OUC
Is there... (3 Replies)
Hi all,
Before I start writing my own file maintenance script, maybe one such program/scripts already exist somewhere :-)
Am looking for a file maintenance script/application that is configurable that I can use to process files under certain criteria, for example, removing files that are... (4 Replies)
Hello.
The last days I extended an open-source C++ library by some faster functions. This library provides a lot of short test programs which guarantee that the library works exactly.
The compilation of each test works in a Makefile automatically.
What I need is a shell script which... (5 Replies)
Hello all,
I have files at /var/dir1/dir2/fil1.log etc.,.
dir2 is symlinked to /export/xxx/dir3
I am trying to monitor the disk space of the mount where these log files are present.
How do I determine dynamically the actual directory of the log files and corresponding mount when I use df... (3 Replies)
Hello,
I have a script where I get the full directory path of the script being executed:
BASE=$0
echo "BASE:" $BASE
The output looks like this:
BASE: /webapps/appsdev/ACURA/rlz/oses3.sh
I'd like to truncate the shell name, leaving just the directory path. The directory path can be... (2 Replies)
I would like to create a script for calculating size and remaining space of a directory automatically every 24 hours, then send an email to report to the admin.
* POSIX and PERL are preferred.
Can anyone help, please? (1 Reply)
Every now and then our users post complete programs to this site. It is especially important that these contributions don't get lost, so I will collect them here. Some of these programs are intended to demonstrate a programming technique and some are ready to run. As a guideline, the code... (0 Replies)
Hey everyone,
I'd like to determine the absolute path of where a script resides from within the same script. For example, I have a script - /tmp/myscript. Regardless of how that script is call - '/tmp/myscript', 'cd /tmp;./myscript', '. /tmp/myscript' - I'd like to be able to determine - from... (5 Replies)