LinuxQuestions.org
View the Most Wanted LQ Wiki articles.
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices



Reply
 
Search this Thread
Old 11-06-2004, 04:04 AM   #1
zexter
Member
 
Registered: Oct 2003
Location: Saint Louis, Missouri
Distribution: Mandrake 10 Official
Posts: 210

Rep: Reputation: 30
how to make a file that will open specific things for you


how would i go about making a file that would open up a certain directory instead of me typing cd "directory" everytime i want to use that program?


-thanks in advance
 
Old 11-06-2004, 04:10 AM   #2
n0xvb
Member
 
Registered: Sep 2004
Location: 127.0.0.1
Distribution: Slackware 13; openSUSE 11.2
Posts: 255

Rep: Reputation: 32
You can create a script file that would do that for you.. Let's call this file

gothere


#!/bin/sh
#
#
cd /go/to/this/directory
#


That's it! Put whatever directory in that you want after the cd.
After you create this file, do this command:

chmod +x gothere

And if you want it to be available no matter what directory you are currently in, do something like this:

cp gothere /usr/bin/gothere
 
Old 11-06-2004, 08:04 AM   #3
Cedrik
Senior Member
 
Registered: Jul 2004
Distribution: Slackware
Posts: 2,140

Rep: Reputation: 242Reputation: 242Reputation: 242
Or you could use your shell alias function, like in Bash :
alias myprogram="cd /path/to/your/directory; ./myprogram"

then you just type :
myprogram
to access the directory and execute 'myprogram' from here
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

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 Off
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to make a specific command(s) work for specific users or group only naren_0101bits Linux - General 3 08-28-2005 06:22 PM
How to make a specific command(s) work in a specific shell only naren_0101bits Linux - Newbie 3 08-28-2005 02:24 PM
I cannot make rox open a +x file as normal files codec Linux - Software 1 05-02-2004 07:04 AM
How to open or make a .php file in emacs?? eye Linux - Software 1 12-02-2003 01:19 AM
best book for learning general things about (not specific topic) redhat 9.0 chinmay nautiya Linux - Software 6 07-03-2003 02:02 PM


All times are GMT -5. The time now is 10:59 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration