Location: Saint Paul, MN USA / BSD, CentOS, Debian, OS X, Solaris
Posts: 2,288
Thanks Given: 430
Thanked 480 Times in 395 Posts
Managing functions
Hi.
I also like functions, but they can cause clutter and complexity. One way to address that is to use an autoload-like facility. Such a feature allows the functions to be placed in a separate directory, say ~/.functions, one function (or group of related functions) to a file. I think these ideas were first found in ksh.
Regrettably, autoload is not built into bash. However, you may have access to a set of functions that perform that task. In my main workstation system (Debian 5, lenny), these functions are in:
in the filenames containing the string autoload.
I have used them with (most recently) GNU bash 3.2.39 and they seem to work correctly.
So whenever you create a new function, or you find something interesting on the 'net, you can just drop the file in .functions, and you'll be set.
Looking briefly over my examples, the functions in .functions can be made to work with ksh (and probably zsh, but I have not tried that), assuming no bashisms are present.
Hi,
Below is what i have in my profile:
alias wldm='cd /opt/app/wls'
If i use bash or ksh shell this alias does not work.
What should be done for this alias to work with all these simultaneously -> No Shell, bash shell, and ksh shell (14 Replies)
using kerberos to access remote server. first I execute kshell to create subshell and then kinit username@domain in that subshell. After that it prompts to enter password.
Since I need to do this over and over, I am trying creating alias. I tried
kshell; kinit username@domain. Did not work,... (7 Replies)
Hi all,
In a directory, I have many video files. Example :
As you can see, some of the video files come with a .aspx file (wich
means the video is actually being uploaded and not entirely written on
the FS)
I try to write a bash script that would find all video files in the
... (1 Reply)
I am new to unix and therefore I did a lot of reading before posting. So please, if this has been answered before, forgive me for re-posting and point me to the right place for the answer. I have spent many hours searching the net and read over 50 posts in this forum and even tried a few thing but... (20 Replies)
hi guys
i m making one alias which will set variable , invoke sqlplus and also set prompt of sqlplus,,i have made successfully upto invoking sqlplus in unix but cant pass command in sqlplus
here is the command
alias sett='export ORACLE_SID=devdb2;sqlplus system/system@test'
now this... (3 Replies)
Hi I have a serious issue when trying to join to files
so I have two files, one for meals and one for people
Meal1:Turkey:Potato Chips:Twinkie:Coke:5.95
Meal2:Ham & Cheese:Doritos:Cookie:Sprite:6.49
Meal3:Vegetarian:Cheese Crackers:Brownie:Pepsi:5.75
Meal4:Tuna:Cheese Puffs:Eclair:Diet... (1 Reply)
Hi
Linux
Set up - alias ls='ls -l'
Then run script
#! /bin/ksh
sub()
{
ls
}
sub
Is there any way to get it working. I don't want to define alias inside of the program
Thank you (2 Replies)
In all of my brief and superficial experience with Unix or Linux, the one curious and consistent thing has been that 'cd ./' (back up one directory level) has done absolutely nothing in any of them. Now I understand that, at least for bash, 'cd ./' appears to have been substituted by 'cd ..'
Am... (1 Reply)
Hi
I have put alias ll='ls -la' in .profile file but it doesn't work.
On hand it works it looks like the .profile file is not beeing read.
How to check whitch file is loaded? ,profile? .bash_profile?
My system: SunOS mion 5.10 Generic
Shell: /bin/pfksh
Thanks (2 Replies)