Re: Show us your /etc/profile

2015-08-31 Thread sven falempin
PS1='[\[`if test $? -eq 0; then echo "\e[1;32m"; else echo "\e[1;31m"; fi`\]$?\[\e[0m\]]-[\[\e[0;34m\]\h\[\e[0m\]]-[\[\e[0;34m\]\w\[\e[0m\]]\[\n\]\$ ' Where is that awesome post about the CRC24 to get a nice color for each hostname ? There:

Re: Show us your /etc/profile

2015-08-29 Thread Matthieu Herrb
On Fri, Aug 28, 2015 at 11:01:45AM +0200, Martijn van Duren wrote: Here's some potential useful feature from my .profile. It might not be perfect, but at least it's better then some of the generators I've seen in production. # $RANDOM is not portable and in ksh it's limited to 32767. rand()

Re: Show us your /etc/profile

2015-08-29 Thread Paul de Weerd
On Sat, Aug 29, 2015 at 12:26:37PM +0200, Matthieu Herrb wrote: | On Fri, Aug 28, 2015 at 11:01:45AM +0200, Martijn van Duren wrote: | Here's some potential useful feature from my .profile. It might not be | perfect, but at least it's better then some of the generators I've seen in |

Re: Show us your /etc/profile

2015-08-28 Thread Martijn van Duren
Here's some potential useful feature from my .profile. It might not be perfect, but at least it's better then some of the generators I've seen in production. # $RANDOM is not portable and in ksh it's limited to 32767. rand() { local number local rdevice for rdevice in

Re: Show us your /etc/profile

2015-08-28 Thread T B
On Fri, Aug 28, 2015 at 1:20 AM, Alexander Hall alexan...@beard.se wrote: I'm pretty sure this messes up $? at the prompt. Try: false echo $? You could circumvent this by saving $? at the beginning of the function and returning it at the end. Happy to report that this is not the

Re: Show us your /etc/profile

2015-08-28 Thread Patrick Dohman
My back to SCO additions… #-# # Print the current directory, hostname user# #-# HOST=`hostname` PS1='$(print -n [${USER}@${HOST%%.*} ;[[ $HOME == $PWD ]] print -n ~ ||([[ ${PWD##*/} == ]] print -n / || print -n

Re: Show us your /etc/profile

2015-08-28 Thread Jérémie Courrèges-Anglas
Alexander Hall alexan...@beard.se writes: [...] I'm pretty sure this messes up $? at the prompt. Try: false echo $? You could circumvent this by saving $? at the beginning of the function and returning it at the end. Here's an excerpt of my .kshrc. The '$' is printed in red if

Re: Show us your /etc/profile

2015-08-27 Thread Alexander Hall
On August 28, 2015 2:36:38 AM GMT+02:00, T B phreakoci...@gmail.com wrote: Resurrecting this not-too-old thread. You might find this one useful if you run CARP firewalls which gives you a dynamic prompt telling you the master/backup/other status. function fwStatus { IFCONFIG=`ifconfig -a

Re: Show us your /etc/profile

2015-08-27 Thread T B
Resurrecting this not-too-old thread. You might find this one useful if you run CARP firewalls which gives you a dynamic prompt telling you the master/backup/other status. function fwStatus { IFCONFIG=`ifconfig -a | grep carp:` NUMCARPS=`echo $IFCONFIG | wc -l`

Re: Show us your /etc/profile

2015-08-04 Thread Sean Kamath
On Aug 2, 2015, at 8:49 AM, li...@wrant.com wrote: never thought of using a shell function in .profile till I read this thread. ... Functions has always been impressive once you move past the alias shortcomings (can't handle arguments etc), so also worth a read the Functions

Re: Show us your /etc/profile

2015-08-02 Thread Alessandro DE LAURENZIS
Hello Vijay, On Sat 01/08/2015 14:09, Vijay Sankar wrote: [...] To quickly see how many files I have in a directory, I use alias nof='ls -l . | egrep -c '^-'' I have always wondered if there is a better way of doing this. In general, I would avoid using a pipe when a native command exists

Re: Show us your /etc/profile

2015-08-02 Thread Raul Miller
On Sun, Aug 2, 2015 at 6:35 AM, Alessandro DE LAURENZIS just22@gmail.com wrote: On Sun 02/08/2015 08:23, Alessandro DE LAURENZIS wrote: operation); this could probably be more appropriate: alias nof='find ./ -type f -maxdepth 1 | wc -l' Ok, that's clearly inefficient because the search

Re: Show us your /etc/profile

2015-08-02 Thread Alessandro DE LAURENZIS
On Sun 02/08/2015 08:23, Alessandro DE LAURENZIS wrote: [...] operation); this could probably be more appropriate: alias nof='find ./ -type f -maxdepth 1 | wc -l' Ok, that's clearly inefficient because the search is performed in all subtrees, instead of cwd only; maybe this: find . ! -name .

Re: Show us your /etc/profile

2015-08-02 Thread Benny Lofgren
On 2015-08-02 08:23, Alessandro DE LAURENZIS wrote: On Sat 01/08/2015 14:09, Vijay Sankar wrote: alias nof='ls -l . | egrep -c '^-'' I have always wondered if there is a better way of doing this. In general, I would avoid using a pipe when a native command exists (and particularly in this

Re: Show us your /etc/profile

2015-08-02 Thread Vijay Sankar
Quoting Benny Lofgren bl-li...@lofgren.biz: On 2015-08-02 08:23, Alessandro DE LAURENZIS wrote: On Sat 01/08/2015 14:09, Vijay Sankar wrote: alias nof='ls -l . | egrep -c '^-'' I have always wondered if there is a better way of doing this. In general, I would avoid using a pipe when a

Re: Show us your /etc/profile

2015-08-02 Thread lists
never thought of using a shell function in .profile till I read this thread. Maybe redundant but worth checking ksh(1), and search for kshrc, right after the description and arguments. The section (ENV parameter) describes strategy to keep your .profile cleaner for login shells and

Re: Show us your /etc/profile

2015-08-01 Thread Christian Weisgerber
On 2015-07-31, listas...@dna.uba.ar listas...@dna.uba.ar wrote: What aliases or custom functions do you use? Nothing exciting. Here's a useful one not everybody might know about: alias doas='doas ' Also, just for kicks I keep these around, although they aren't terribly useful in a windowing

Re: Show us your /etc/profile

2015-08-01 Thread Bernte
On 31/07/15 21:25, listas...@dna.uba.ar wrote: How do you customize your environment? What aliases or custom functions do you use? Here's my /etc/profile I think you can find one or two interesting things in it. Ouch - this hits a nerve. @work, we have a Unix environment where the powers

Re: Show us your /etc/profile

2015-08-01 Thread Vijay Sankar
Quoting listas...@dna.uba.ar: Hello everybody How do you customize your environment? What aliases or custom functions do you use? Here's my /etc/profile I think you can find one or two interesting things in it. Show us yours! (in case wordwrapping breaks long lines:

Re: Show us your /etc/profile

2015-08-01 Thread Gregor Best
On Fri, Jul 31, 2015 at 05:25:49PM -0300, listas...@dna.uba.ar wrote: [...] How do you customize your environment? [...] Colorful prompt with power line glyphs and SCM branch and routing table id display [0]. What aliases or custom functions do you use? [...] My favorites are alias

Re: Show us your /etc/profile

2015-08-01 Thread Raul Miller
On Fri, Jul 31, 2015 at 4:25 PM, listas...@dna.uba.ar wrote: How do you customize your environment? What aliases or custom functions do you use? Here's what I use: PATH=$HOME/bin:$PATH EDITOR=vi export EDITOR Pretty exciting, no? Customizations go in $HOME/bin ... and looking at the sort

Re: Show us your /etc/profile

2015-08-01 Thread Ruslanas Gžibovskis
Nice! I am stealing idea! Thanks! Will share what i will be able to. On Fri, 31 Jul 2015 23:27 listas...@dna.uba.ar wrote: Hello everybody How do you customize your environment? What aliases or custom functions do you use? Here's my /etc/profile I think you can find one or two

Re: Show us your /etc/profile

2015-08-01 Thread Gilles Chehade
On Fri, Jul 31, 2015 at 05:25:49PM -0300, listas...@dna.uba.ar wrote: Hello everybody Hello, alias ducks='du -cks * |sort -rn |head -11' I'm stealing this one ;-) -- Gilles Chehade https://www.poolp.org @poolpOrg

Show us your /etc/profile

2015-07-31 Thread listas-it
Hello everybody How do you customize your environment? What aliases or custom functions do you use? Here's my /etc/profile I think you can find one or two interesting things in it. Show us yours! (in case wordwrapping breaks long lines: http://pastie.org/10322761)

Re: Show us your /etc/profile

2015-07-31 Thread lists
Hello everybody Hello, anonymous. How do you customize your environment? Reading man pages mostly, and teraforming using (brain) farts. What aliases or custom functions do you use? On the blog over 15 pages across several years, just kidding. Here's my /etc/profile I think you can find