aa09 How to make a custom command (shortcut) ,set default path and more - The FreeBSD Forums
The FreeBSD Forums  

Go Back   The FreeBSD Forums > Base System > General

General General questions about the FreeBSD operating system. Ask here if your question does not fit elsewhere.

Reply
 
Thread Tools Display Modes
  #1  
Old August 14th, 2012, 22:37
BSDN00b BSDN00b is offline
Junior Member
 
Join Date: Aug 2012
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default How to make a custom command (shortcut) ,set default path and more

Hello,

I would like to know how can I make a custom command for FreeBSD 8.2?
For example: I need to type : /usr/cst/no then sh open.sh.
1. how can I make a simple command for executing the file from that folder? for example : start command will execute the open.sh from /no/ folder.
2.How to set a default path when I open FreeBSD?
3.How to learn FreeBSD? I want to learn and understand the FreeBSD system, creating scripts and so on..

Thanks

Last edited by SirDice; August 15th, 2012 at 11:41. Reason: It's 'FreeBSD', no exceptions: http://forums.freebsd.org/showthread.php?t=18043#FreeBSD
Reply With Quote
  #2  
Old August 15th, 2012, 11:44
SirDice's Avatar
SirDice SirDice is offline
Moderator
 
Join Date: Nov 2008
Location: Rotterdam, Netherlands
Posts: 13,694
Thanks: 47
Thanked 2,020 Times in 1,859 Posts
Default

Quote:
Originally Posted by BSDN00b View Post
I would like to know how can I make a custom command for FreeBSD 8.2?
FreeBSD 8.2 went End-of-Life at the end of last month. Update to 8.3.

Quote:
For example: I need to type : /usr/cst/no then sh open.sh.
1. how can I make a simple command for executing the file from that folder? for example : start command will execute the open.sh from /no/ folder.
For tcsh(1):
alias mycommand (cd /usr/cst/no && sh ./open.sh)

Quote:
2.How to set a default path when I open FreeBSD?
Edit your ~/.cshrc. Look for a line:
Code:
set path = (/sbin /bin /usr/sbin /usr/bin /usr/games /usr/local/sbin /usr/local/bin $HOME/bin)
This sets your path.
__________________
Senior UNIX Engineer at Unix Support Nederland
Experience is something you don't get until just after you need it.
Reply With Quote
  #3  
Old August 21st, 2012, 01:45
fbsd1 fbsd1 is offline
Member
 
Join Date: Feb 2010
Location: Angeles City, Philippines
Posts: 199
Thanks: 0
Thanked 42 Times in 28 Posts
Default

As you see at the end of the path command above is $HOME/bin. What this means is if you $ mkdir bin from your user's home dir, then any script you place in the bin directory will exec when you enter it on the command line. So create your self scripts containing any combination of commands you want, save to your /home/accountname/bin, rehash and then enter script on command line and it will run.
__________________
FreeBSD Install Guide www.a1poweruser.com
Maintainer of the sysutils/qjail port

Last edited by phoenix; August 22nd, 2012 at 00:57. Reason: Please format your posts!
Reply With Quote
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
[Solved] Show the full path in the command line ccc General 11 August 26th, 2011 00:53
[Solved] Changing the default baud for cu command bsdnewb Embedded 5 March 4th, 2011 08:25
make install /path/ arguments sossego Installation and Maintenance of FreeBSD Ports or Packages 0 June 6th, 2010 20:50
[Solved] Custom command in install.cfg FreddieB Installing & Upgrading 4 June 1st, 2010 08:09
It is possible to make a recovery disc or custom dvd ericturgeon Installing & Upgrading 3 March 26th, 2009 16:55


All times are GMT +1. The time now is 13:51.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2013, vBulletin Solutions, Inc.
The mark FreeBSD is a registered trademark of The FreeBSD Foundation and is used by The FreeBSD Project with the permission of The FreeBSD Foundation.
Web protection and acceleration provided by CloudFlare
0