LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
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


Reply
  Search this Thread
Old 01-03-2008, 08:16 AM   #16
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15

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 !
 
Old 01-03-2008, 08:31 AM   #17
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
shall i mention the source / . command for the third time??
 
Old 01-03-2008, 08:35 AM   #18
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
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 !
 
Old 01-03-2008, 08:44 AM   #19
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by mayaabboud View Post
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.
 
Old 01-03-2008, 08:45 AM   #20
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
source? wassat?
 
Old 01-03-2008, 08:51 AM   #21
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
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 !
 
Old 01-03-2008, 08:55 AM   #22
acid_kewpie
Moderator
 
Registered: Jun 2001
Location: UK
Distribution: Gentoo, RHEL, Fedora, Centos
Posts: 43,417

Rep: Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985Reputation: 1985
ughh... wherever you are writing that, just add ". ~/.profile" instead, and then those functions will become local.
 
Old 01-03-2008, 09:05 AM   #23
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
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
 
Old 01-03-2008, 09:43 AM   #24
weibullguy
ReliaFree Maintainer
 
Registered: Aug 2004
Location: Kalamazoo, Michigan
Distribution: Slackware 14.2
Posts: 2,815
Blog Entries: 1

Rep: Reputation: 261Reputation: 261Reputation: 261
Quote:
Originally Posted by mayaabboud View Post
i already read everythg there is on shell scripting!
WOW!!!!

http://www.gnu.org/software/bash/manual/bashref.html
http://tldp.org/LDP/abs/html/abs-guide.html
 
Old 01-03-2008, 09:49 AM   #25
mayaabboud
Member
 
Registered: Oct 2007
Posts: 53

Original Poster
Rep: Reputation: 15
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
 
Old 01-03-2008, 05:00 PM   #26
lopoetve
Member
 
Registered: Aug 2001
Distribution: Too many.
Posts: 102

Rep: Reputation: 15
Quote:
Originally Posted by mayaabboud View Post
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.
 
Old 01-03-2008, 05:28 PM   #27
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
Quote:
Originally Posted by acid_kewpie View Post
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!!! !!! :-]
 
Old 01-03-2008, 05:35 PM   #28
dive
Senior Member
 
Registered: Aug 2003
Location: UK
Distribution: Slackware
Posts: 3,467

Rep: Reputation: Disabled
A bit pointless doing this in a live cd though, unless you never reboot?
 
  


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
Shell Scripting: Getting a pid and killing it via a shell script topcat Programming 15 10-28-2007 02:14 AM
teaching shell scripting: cool scripting examples? fax8 Linux - General 1 04-20-2006 04:29 AM
shell scripting commands and yum= geminigal Linux - Newbie 2 05-13-2005 03:12 AM
shell scripting -- passing commands mehesque Linux - General 4 06-25-2004 10:28 AM
I need a scripting lanuage with case and shell commands rob.rice Programming 1 04-18-2004 02:17 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 05:49 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
Open Source Consulting | Domain Registration