Sponsored Content
Full Discussion: Rh 7.3 Q
Top Forums UNIX for Dummies Questions & Answers Rh 7.3 Q Post 34752 by LivinFree on Sunday 9th of March 2003 04:55:22 PM
Old 03-09-2003
To run scripts like that, you'll have to modify your search path. Open your .bash_profile or .bashrc (the preferred file), and add a line like below:
Code:
export PATH="$PATH:."

You're just adding "." (a link to your current directory) to the end of your path, and keeping the rest as-is.

Keep in mind that you may run into issues, and it's much safer to use a full or relative path, especially as root. For example, say someone creates a script in /tmp named "test". If by some chance, "." ends up in the front of your path, and your pwd is in /tmp, you will run that test instead of /bin/test... More dangerous as root, but it's something everyone should get used to doing.

As for your boot question, Redhat uses /etc/rc3.d/* to start up programs. There is a nice interface to it: /usr/sbin/ntsysv
If you want to add some custom startup stuff (for example, I create and mount a Ramdisk each time I boot up on one of my machines), a simple way to do it without writing a huge script is just to add your script inline to /etc/init.d/rc.local (I think that's where it is - I don't have access to a Redhat machine, ATM).

Please keep in mind that this is run as root, and doing wierd things to your botup scripts can cause some trouble... always make backups of the file before modifying it, and test your code thoroughly.
 
Test::Script(3) 					User Contributed Perl Documentation					   Test::Script(3)

NAME
Test::Script - Basic cross-platform tests for scripts DESCRIPTION
The intent of this module is to provide a series of basic tests for 80% of the testing you will need to do for scripts in the script (or bin as is also commonly used) paths of your Perl distribution. Further, it aims to provide this functionality with perfect platform-compatibility, and in a way that is as unobtrusive as possible. That is, if the program works on a platform, then Test::Script should always work on that platform as well. Anything less than 100% is considered unacceptable. In doing so, it is hoped that Test::Script can become a module that you can safely make a dependency of all your modules, without risking that your module won't on some platform because of the dependency. Where a clash exists between wanting more functionality and maintaining platform safety, this module will err on the side of platform safety. FUNCTIONS
script_compiles script_compiles( 'script/foo.pl', 'Main script compiles' ); The "script_compiles" test calls the script with "perl -c script.pl", and checks that it returns without error. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. Note also that the test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. script_runs script_runs( 'script/foo.pl', 'Main script runs' ); The "script_runs" test executes the script with "perl script.pl" and checks that it returns success. The path it should be passed is a relative unix-format script name. This will be localised when running "perl -c" and if the test fails the local name used will be shown in the diagnostic output. The test will be run with the same perl interpreter that is running the test script (and not with the default system perl). This will also be shown in the diagnostic output on failure. SUPPORT
All bugs should be filed via the bug tracker at http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script <http://rt.cpan.org/NoAuth/ReportBug.html?Queue=Test-Script> For other issues, or commercial enhancement and support, contact the author. AUTHOR
Adam Kennedy <adamk@cpan.org> SEE ALSO
prove, <http://ali.as/> COPYRIGHT
Copyright 2006 - 2009 Adam Kennedy. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. The full text of the license can be found in the LICENSE file included with this module. perl v5.16.2 2009-11-23 Test::Script(3)
All times are GMT -4. The time now is 07:25 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy