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 20th August 2021
pseudostem pseudostem is offline
New User
 
Join Date: Jun 2021
Posts: 4
Default [Solved] doas and aliases in .profile

Hello,

I have appended the following to myusername's .profile:
Code:
alias ls='colorls -G'
alias vi='nvim '
Works like a charm. However when I
Code:
$doas vi /etc/doas.conf
it defaults to vi as an editor. I tried appending the above to root's .profile with no luck.

man doas.conf & man doas do not yield much either.

Any ideas?

Last edited by pseudostem; 20th August 2021 at 03:49 PM. Reason: marking solved
Reply With Quote
  #2   (View Single Post)  
Old 20th August 2021
jggimi's Avatar
jggimi jggimi is offline
More noise than signal
 
Join Date: May 2008
Location: USA
Posts: 7,416
Default

The doas(1) utility is NOT a shell.* As an example, the doas.conf(5) man page specifies that when you permit or deny a command with arguments, the argument string must match exactly, no wildcard or shell expansion is allowed.

One possible solution for your issue would be to create an alias for `doas nvim`.

---

* Yes, doas() will call an interactive shell of your choice when you use the -s option, but that is not the same as being a shell.
Reply With Quote
  #3   (View Single Post)  
Old 20th August 2021
pseudostem pseudostem is offline
New User
 
Join Date: Jun 2021
Posts: 4
Default

Quote:
Originally Posted by jggimi View Post
One possible solution for your issue would be to create an alias for `doas nvim`.
Thank you! Although this did not work for me, the following did:
Quote:
* Yes, doas() will call an interactive shell of your choice when you use the -s option, but that is not the same as being a shell.
Finally I used
Code:
alias doas='doas '
in my .profile

I read from
Code:
man alias
on the internet (man alias GNU)
Quote:
A trailing space in VALUE causes the next word to be checked for alias substitution when the alias is expanded.
To crosscheck I did
Code:
$man ksh
Quote:
An expanded alias is re-processed to check for more aliases. If a command alias ends in a space or tab, the following word is also checked for alias expansion.
Although a bit counterintuitive, OpenBSD documentation never ceases to amaze me.

Thank you for all your help!
Reply With Quote
Reply

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
st not seeing aliases stanl OpenBSD Packages and Ports 9 27th May 2020 08:56 PM
Why doesnot OpenBSD run /etc/profile and ~/.profile ? sw2wolf OpenBSD General 2 28th August 2012 11:26 PM
gnome's console is unaware of xterm aliases daemonfowl OpenBSD General 6 26th February 2012 03:23 PM
Shell aliases for regular user dbach OpenBSD General 5 30th December 2011 11:41 PM
postfix aliases configuration error xiphias FreeBSD Ports and Packages 5 5th June 2010 05:35 PM


All times are GMT. The time now is 06:20 PM.


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