LinuxQuestions.org
Visit Jeremy's Blog.
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 04-03-2014, 10:02 AM   #1
Jspradling84
LQ Newbie
 
Registered: Apr 2014
Posts: 1

Rep: Reputation: Disabled
Question question about functions in .bashrc


I created some simple functions to sort information from a file. when added I am getting an error saying cant find source files.
when I used ls it shows the file is there.
so instead of always being able to call my function
it will only let me while I am in the directory the code initially is written in

very respectfully

josh
 
Old 04-03-2014, 10:33 AM   #2
MARogue
Member
 
Registered: Jul 2011
Location: USA
Distribution: Ubuntu 12.04 , Debian "Wheezy"
Posts: 56

Rep: Reputation: Disabled
Hello Josh and Welcome to LQ!
Quote:
so instead of always being able to call my function
it will only let me while I am in the directory the code initially is written in
IT looks like your executable is not in your $PATH. The following will tell you directories where you need to save the executable file
Code:
echo $PATH
The output will give you a list of directories that make up $PATH. You can choose any one of these directories and save the shell script executable file. At this point you shouldnt have any restrictions on where you run the script from.
Hope that helps.
 
Old 04-03-2014, 10:40 AM   #3
onebuck
Moderator
 
Registered: Jan 2005
Location: Midwest USA, Central Illinois
Distribution: SlackwareŽ
Posts: 12,541
Blog Entries: 23

Rep: Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943Reputation: 1943
Member Response

Hi,

Welcome to LQ!

Quote:
Just a few links to aid you to gaining some understanding;



1 Linux Documentation Project
2 Rute Tutorial & Exposition
3 Linux Command Guide
4 Bash Beginners Guide
5 Bash Reference Manual
6 Advanced Bash-Scripting Guide
7 Linux Newbie Admin Guide
8 LinuxSelfHelp
9 Utimate Linux Newbie Guide
10 Linux Home Networking
11 Virtualiation- Top 10

The above links and others can be found at 'Slackware-Links'. More than just SlackwareŽ links!
Advanced Bash-Scripting Guide
 shows several examples, one that should help you to understand sourcing & functions: http://www.faqs.org/docs/abs/HTML/sample-bashrc.html

I do suggest that you use other links in the above Quote.

Hope this helps.

Last edited by onebuck; 04-03-2014 at 10:52 AM. Reason: formating errors
 
Old 04-04-2014, 06:05 AM   #4
chrism01
LQ Guru
 
Registered: Aug 2004
Location: Sydney
Distribution: Centos 6.8, Centos 5.10
Posts: 17,240

Rep: Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324Reputation: 2324
Show your code.
Note also that .bashrc only gets called when you login, not dynamically. Try logging out and back in.
 
  


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
editing users.bashrc to add a functions file dnoll17315 Linux - Newbie 1 03-27-2008 07:41 PM
basic bashrc question jerf Linux - Newbie 3 09-17-2007 04:59 AM
basic .bashrc question TheGNUbie Linux - Newbie 1 03-08-2007 12:05 PM
.bashrc question aizkorri Programming 6 08-14-2002 07:41 AM
Question on .bashrc Fluke Linux - Newbie 2 06-29-2002 02:40 PM


All times are GMT -5. The time now is 08:38 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
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration