I would like to keep my .bashrc and .bash_login files in version control so that I can use them between all the computers I use. The problem is I have some OS specific aliases so I was looking for a way to determine if the script is running on OS X, Linux or Cygwin.
What is the proper way to detect the operating system in a bash script...
I've used a number of different *nix-based systems of the years, and it seems like every flavor of Bash I use has a different algorithm for deciding which startup scripts to run. For the purposes of tasks like setting up environment variables and aliases and printing startup messages (e.g. MOTDs), which startup script is the appropriate...
I'm trying to run the following command:
find . -iname '.#*' -print0 | xargs -0 -L 1 foobar
where "foobar" is an alias or function defined in my .bashrc file (in my case, it's a function that takes one parameter). Apparently xargs doesn't recognize these as things it can run. Is there a clever way to remedy this?
...
I made an Unix command, macmac2unix, which converts Mac's Word file for Unix platforms.
I would like to run the command as
$macmac2unix file1 file2 file3 ...
Problem:
How can I run this command in every path?
I added the following to .bashrc unsuccessfully
CDPATH=:/Users/Sam/Documents/Unix
...
Stevey recommends to set the following command to .bashrc
TERM=xterm-256color
I put the code to the top of my .bashrc and I have now a flashing black green terminal. The font color in my terminal switches from black to green and vice versa periodically.
What did I do wrong?
...
I am trying to move to zsh from Bash.
I put my .bashrc directly to my .zshrc, and it caused a lot of errors when I try to use Bash again.
How can you export your .bashrc to .zshrc?
...
When I ssh into my ubuntu-box running Hardy 8.04, the environment variables in my .bashrc are not set.
If I do a source .bashrc, the variables are properly set, and all is well.
How come .bashrc isn't run at login?
...
I have a useful little command that searches through all files & subdirectories for a particular string:
find . -name "*" -exec grep -il "search term" {} \;
I'd like to turn this into a function that I can put in my .bashrc and call from my shell without needing to remember the whole thing, but I can't get it working. This is what I h...
Hi,
My .bashrc looks something like this...
export PERL5LIB="/tools/perl/Linux/${PLAT}/lib/perl5/5.10.0/${PLAT}-thread-multi"
export PERL5LIB="${PERL5LIB}:/tools/perl/Linux/${PLAT}/lib/perl5/5.10.0"
function dev {
export PERL5LIB="/dev/tools/perl/Linux/${PLAT}/lib/perl5/5.10.0/${PLAT}-thread-multi"
export PERL5LIB="${PERL5LIB...
I have some aliases and functions defined in ~/.bashrc.
I start emacs from a terminal window using emacs -nw
When I execute M-x shell-command, the aliases and functions from ~/.bashrc are not available, but give a "command not found".
I've googled quite a bit but all the posts I come across say, if I understand them correctly, that...
I want to have my .bashrc detect if running emacsclient would work in lieu of running emacs. Basically:
if emacs_server_is_running; then
EDITOR=emacsclient
VISUAL=emacsclient
else
EDITOR=emacs
VISUAL=emacs
fi
What would I put in the emacs_server_is_running function to accomplish this aim?
...
I'm looking for a bash function that will shorten long path names to keep my PS1 variable from getting excessively long. Something along the lines of:
/this/is/the/path/to/a/really/long/directory/i/would/like/shortened
might end up as:
/t../i../t../p../to/a/r../l../d../i/w../like/shortened
something that the took the path and a ma...
Can I have certain settings that are universal for all my users?
...
I have a script which executes a git-pull when I log in. The problem is, if I su to a different user and preserve my environment with an su -lp, the script gets run again and usually gets messed up for various reasons because I'm the wrong user. Is there a way to determine in a shell script whether or not I'm currently SUing? I'm looking...
i have the following alias set in my .bashrc:
alias la='ls -laG'
but i would really like to issue a command thusly:
la foo/bar
i guess i have to write a shell script? or is there some xargs way?
...
Cygwin user here (though if there's a suitable solution I will carry it over to K/Ubuntu, which I also use).
I have a Welcome message in my .bashrc that looks like the following:
SAD=(`date +%A-%B-%d-%Y`)
DUB=(`date -u +%k:%M`)
printf "Today's Date is: ${SAD}.\n"
printf "Dublin time is now ${DUB}. (24-Hour Clock)\n"
After numerous at...
Hi all. I recently added these lines to my ~/.bashrc file to show the current branch if i'm in a git working folder, and it works nicely for that. However, what i've lost is that the current folder name used to be shown in the tab for the terminal i have open, and now it isn't: it always just says 'Terminal'. Can i get that back and s...
I recently inherited a Ubuntu Hardy box that acts rather funky out-of-the-box. The first things I tried to do was edit my .bashrc profile to do some coloring and add some aliases I usually have, but then when I try to source the ~/.bashrc I get sh: source: not found and I have also noticed tabbed autocomplete is also not working at all -...
I am looking to start a community based on user posted scripts such as bashrc, screenrc, aliases, etc.
Does anyone know of a web application in PHP that would do that?
I am not looking for a snippet program, or a link directory.
Users can store linux/UNIX/Windows configuration files, as well as maybe an option to attach a screenshot....
Each of my users has a (possibly) different TZ defined in their .bashrc. I have a Perl script that displays date/time and want it to have it display with their profile time zone.
Does anyone know the best way to do this?
...