Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question?
If it is not in the man pages or the how-to's this is the place! |
Notices |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
|
|
01-03-2008, 08:16 AM
|
#16
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
yes , typing histoire in my xterm and using it as a built-in function is what i want,
but i want to keep the functions in my .profile file !
|
|
|
01-03-2008, 08:31 AM
|
#17
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
shall i mention the source / . command for the third time??
|
|
|
01-03-2008, 08:35 AM
|
#18
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
i dont understand where to write that command ?
i dont have a .bashrc file.
the only file that i ve got is bash.bashrc and i dont have permission to write in that one,
so where should the source command go ..i have really no idea !
i am working using a knoppix cd ! i have a tmp directory that i ve added to my PATH !
|
|
|
01-03-2008, 08:44 AM
|
#19
|
ReliaFree Maintainer
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
|
Quote:
Originally Posted by mayaabboud
yes , typing histoire in my xterm and using it as a built-in function is what i want,
but i want to keep the functions in my .profile file !
|
Look, Bash works the way the Bash developers intend it to work. If you want it to work some specific way, then you need to take the time to understand how Bash works. Believe it or not there is a freely available reference manual for Bash.
You have (more than) enough information in this thread to keep your functions in ~/.profile and make them available when you execute Bash. But, I'll give you a hint...add the line source ~/.profile to ~/.bashrc and/or ~/.bash_profile.
If ~/.bashrc doesn't exist, then create it. I didn't read carefully enough earlier to see that you were using a LiveCD. I don't use LiveCD's very often, but I believe you have write permission to the home directory. I would also suspect that any files you create will be lost when you reboot. Unless you remaster the LiveCD, you'll have to recreate the files each time you use Knoppix. But, I don't know this for 100% sure.
If you can't write to the home directory, then you will need to use scripts and if your want to just call histoire, then you'll need a script named histoire in /tmp with /tmp added to your PATH. Again, I suspect you'll need to recreate the script each time you boot the LiveCD.
Last edited by weibullguy; 01-03-2008 at 08:57 AM.
|
|
|
01-03-2008, 08:45 AM
|
#20
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
source? wassat?
|
|
|
01-03-2008, 08:51 AM
|
#21
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
i dont have a .bashrc file
all i have is a .profile file added to my PATH !
i already read everythg there is on shell scripting! on the linuxcommand.org website the info is just not enough, i ve been trying to work this one problem out since yesterday,
so i will stick to typing .profile <nameoffunction> for the time being
i dont know where to write this source sentence since i cant access the bash.bashrc file , so thats that i guess !
|
|
|
01-03-2008, 08:55 AM
|
#22
|
Moderator
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417
|
ughh... wherever you are writing that, just add ". ~/.profile" instead, and then those functions will become local.
|
|
|
01-03-2008, 09:05 AM
|
#23
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
thank you for your help
i think that i should install Linux on my computer to be able to continue with this issue, the xterm just disappears everytime i type . .profile !
thanks again
maya
|
|
|
01-03-2008, 09:49 AM
|
#25
|
Member
Registered: Oct 2007
Posts: 53
Original Poster
Rep:
|
are you making fun of me ?
read the sentence till the end smartboy !
i wrote:..on the linuxcommand.org website
and you re just too smart ? hah?
maybe u shouldnt be here in this blog, if u cant be nice !
maya
|
|
|
01-03-2008, 05:00 PM
|
#26
|
Member
Registered: Aug 2001
Distribution: Too many.
Posts: 102
Rep:
|
Quote:
Originally Posted by mayaabboud
accessible means "being able to use them!"
i want to use the commands without having to go to where the file is, open it and run the commands , i want to use them like built-in commands !
|
the easiest way is to stash a link or the program itself in /usr/local/bin or the like. Or make your own program directory and add it to your $PATH.
edit: Missed second page. this won't work on a liveCD
Last edited by lopoetve; 01-03-2008 at 05:02 PM.
|
|
|
01-03-2008, 05:28 PM
|
#27
|
Moderator
Registered: May 2001
Posts: 29,415
|
Quote:
Originally Posted by acid_kewpie
ughh... wherever you are writing that, just add ". ~/.profile" instead, and then those functions will become local.
|
OMG!!! That's just like sourcing stuphhh!!! FCOL! ! I can't fathom why nobody mentioned it before!!! !!! :-]
|
|
|
01-03-2008, 05:35 PM
|
#28
|
Senior Member
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467
Rep:
|
A bit pointless doing this in a live cd though, unless you never reboot?
|
|
|
All times are GMT -5. The time now is 01:59 PM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|