Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how can we put .sh file into an autoexec.bat type of file

Status
Not open for further replies.

akgta

Programmer
Jul 18, 2007
42
CA
how can we put abc.sh file or a set of shell commands into an autoexec.bat type of file

thanks in advance :)
 
If by autoexec.bat you mean to be run when the system reboots, you can put (in Solaris for example) the scripts in directories like /etc/rc2.d or /etc/rc3.d and name them Snnscriptname when nn is a number specifying at which stage of the boot process the script should run (S99 would run it towards the end, for example).

I'm not sure whether BSD works this way too, or whether it uses and inittab arrangement like AIX.

On the other hand, if you mean that scripts are to be run when a user logs in, put an appropraie entry in the users' $HOME/.profile

Hope this helps.

I want to be good, is that not enough?
 
akgta,

To add to KenCunningham's good advice, in FreeBSD you'd just take a shell script like abc.sh, change permissions to make it executable, and drop it into /usr/local/etc/rc.d

Wishdiak
A+, Network+, Security+, MCSE: Security 2003
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top