DaemonForums  

Go Back   DaemonForums > OpenBSD > OpenBSD General

OpenBSD General Other questions regarding OpenBSD which do not fit in any of the categories below.

Reply
 
Thread Tools Display Modes
  #1   (View Single Post)  
Old 26th December 2011
dbach dbach is offline
Port Guard
 
Join Date: Aug 2011
Posts: 23
Angry Shell aliases for regular user

Happy Holidays Everyone:

Been messing with this with no success (this is after many Google searches and man page reviews). Want to set up a simple alias such as dot = 'ls -a |grep "^\." '
I tried it in .cshrc and .profile in users home directory but when I type dot I get the following:
ksh: dot: not found

Thanks for any help or suggestions.
Darryl
Reply With Quote
  #2   (View Single Post)  
Old 27th December 2011
vermaden's Avatar
vermaden vermaden is offline
Administrator
 
Join Date: Apr 2008
Location: pl_PL.lodz
Posts: 1,056
Default

Quote:
.cshrc and .profile in users home directory but when I type dot I get the following:
ksh: dot: not found
The ~/.cshrc is for csh(1) shell, the ~/.profile is for sh(1) shell ... while You are running ksh(1) shell

Type man ksh to see which files are read at Your shell startup and put there that alias.
__________________
religions, worst damnation of mankind
"If 386BSD had been available when I started on Linux, Linux would probably never had happened." Linus Torvalds

Linux is not UNIX! Face it! It is not an insult. It is fact: GNU is a recursive acronym for “GNU's Not UNIX”.
vermaden's: links resources deviantart spreadbsd
Reply With Quote
  #3   (View Single Post)  
Old 27th December 2011
J65nko J65nko is offline
Administrator
 
Join Date: May 2008
Location: Budel - the Netherlands
Posts: 4,125
Default

Vermaden, the OpenBSD ksh also uses .profile
__________________
You don't need to be a genius to debug a pf.conf firewall ruleset, you just need the guts to run tcpdump
Reply With Quote
  #4   (View Single Post)  
Old 27th December 2011
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,975
Default

I use aliases in .cshrc, since I almost always use shells/tcsh as my "default" shell.

These all in my .cshrc :
Code:
alias mutt      mutt -z
alias df        df -h
alias du        du -k
alias f         finger
alias h         'history -r | more'
alias j         jobs -l
alias la        ls -a
alias lf        ls -F
alias lh        ls -lh
alias lr        ls -lhtr
Reply With Quote
  #5   (View Single Post)  
Old 29th December 2011
Carpetsmoker's Avatar
Carpetsmoker Carpetsmoker is offline
Real Name: Martin
Tcpdump Spy
 
Join Date: Apr 2008
Location: Netherlands
Posts: 2,243
Default

Aliases in the bourne shells are different, you'll need to add an equals sign:

Code:
alias dot='ls -a |grep ^\\.'
__________________
UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things.
Reply With Quote
  #6   (View Single Post)  
Old 30th December 2011
dbach dbach is offline
Port Guard
 
Join Date: Aug 2011
Posts: 23
Default Thanks folks, got the aliases working

Added the following to ~/.profile

alias dot='ls -a |grep "^\."'
alias dir='ls -l |grep "^d"'

And they worked perfect.

Thanks again,
Darryl
Reply With Quote
Reply

Tags
shell aliases

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Running a command as a different user w/o starting the login shell Carpetsmoker General software and network 4 1st July 2011 10:33 PM
postfix aliases configuration error xiphias FreeBSD Ports and Packages 5 5th June 2010 05:35 PM
PHP regular expression help cajunman4life Programming 2 16th August 2008 05:17 PM
Mount filesystem with a regular user ivanatora FreeBSD General 15 30th July 2008 08:51 AM
are you an former bsdforum regular? ephemera Off-Topic 18 28th July 2008 12:57 PM


All times are GMT. The time now is 05:46 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick