LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices


Reply
  Search this Thread
Old 10-10-2015, 06:51 AM   #1
narender.thakur
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Rep: Reputation: Disabled
bash_profile defined function | getting redundant calls


Hello Everyone,

I would appreciate some help on the following.

I defined a small sub in .bash_profile, but when the call is made, its getting redundant, if I need to reuse the same function.

For e.g

[Narender@MacBook ~]$ myfunc -u one -m one
User: one
Host: one


[Narender@MacBook ~]$ myfunc -u one -m two
<No Output>


but if I do this,

[Narender@MacBook ~]$ myfunc
<no Output>


and then again,

[Narender@MacBook ~]$ myfunc -u one -m two
User: one
Host: two


its getting right, any thought, why?

Note: I'm using getopts in myfunc to parse options
 
Old 10-10-2015, 03:37 PM   #2
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
I think you will get an answer once you post the code of myfunc.
 
Old 10-10-2015, 04:53 PM   #3
narender.thakur
LQ Newbie
 
Registered: Aug 2015
Posts: 2

Original Poster
Rep: Reputation: Disabled
Thanks @Rinndalir, I could figure it out myself, Thanks and appreciate your time.
 
Old 10-10-2015, 05:10 PM   #4
Rinndalir
Member
 
Registered: Sep 2015
Posts: 733

Rep: Reputation: Disabled
Quote:
Originally Posted by narender.thakur View Post
Thanks @Rinndalir, I could figure it out myself, Thanks and appreciate your time.
That's good news, now you may help someone else with your new knowledge.
 
  


Reply



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



Similar Threads
Thread Thread Starter Forum Replies Last Post
function calls inside a function manas_sem Programming 2 02-28-2007 01:27 AM
Tracing function calls... How? ik_nitk Programming 3 06-05-2006 07:05 AM
Python: making a reference to a function not yet defined JRR883 Programming 1 02-08-2006 11:28 AM
user defined function in kernel vishalbutte Programming 4 02-07-2006 06:01 AM
libc function calls h/w Programming 4 02-13-2004 03:00 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - General

All times are GMT -5. The time now is 12:11 AM.

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