...may be disregarded.
EDIT: Instead of trying to add an alias for the bourne shell via .profile I used a perhaps more obvious choice, namely .shrc
I noticed .shrc does follow the syntax you (and the Wiki about sh) examplify, in terms of quotes anyway:
# some useful aliases
alias h='fc -l'...
...and cd into it"
return ; fi
mkdir -p $1 || return
cd $1
}
Storing several such small things in .bashrc or .shrc is more convenient than creating a standalong script for each of them.
Finally, I think balanga's original question wasn't just whether and how to...
Oops! Thanks. I didn't join the dots.
I guess, I'd edit /root/.shrc (instead of the system login profile) only if it's a multi-user machine with other people specifically wanting vi as the default.
Plus, I just realised, /etc/csh.cshrc as the system-wide .cshrc file for csh(1).
tcsh(1) FILES
Any reason to not (instead) edit these two files?
/root/.cshrc
/etc/profile
If EDITOR is /usr/bin/ee for a privileged user but not for the root user, then (for example) there's a likelihood of /usr/bin/vi in response to sudo freebsd-update upgrade -r 14.0-RELEASE:
I don't think that interactive = login. At least with /bin/sh this is not true. When you switch to it by running sh from within /bin/csh or /usr/local/bin/bash it ignores ~/.profile and ~/.shrc.
...user can set the ENV variable to some file by placing the following line
in the file .profile in the home directory, substituting for .shrc the
filename desired:
ENV=$HOME/.shrc; export ENV
The first non-option argument specified on the command line will be...
I put the alias(es) in .cshrc for tcsh (eg. root) and in .shrc for sh logins. The alias syntax is slightly different - sh wants an equal sign and ticks on the right-hand side.
...account include system
# session
session include system
# password
password include system
~/.shrc is standard
I do have a password, but it's blank.
When booting into single user mode from the boot menu and running mount, it shows that my system is...
That is weird. Maybe you want to check your /etc/pam.d/login and /etc/ttys if there's anything weird going on? I'd also recommend checking your .shrc or what have you shell init script.
I assume your root account does have a password?
Thanks to Charlie_ after many years of using misc/mc, I have now managed to rid of those annoying 'printf' commands in my shell history by putting this in my ~/.shrc
env SHELL=/usr/local/bin/bash mc
...Somewhere there might be someting overseen.
The root shell sh was solved by copying and editing the syntax from my ~/.cshrc backup to the ~/.shrc file. TNX for pointing that I should RTFM!
After all, the upgrade to a new major version is a peace of cake. TNX for all making this possible!!!
With 14.0-R you need to add:-
alias mc='env SHELL=/usr/local/bin/bash mc' to either ~/.cshrc or ~/.shrc depending on which your login in shell is set up to.
Also, you need to have installed shells/bash for this to work
Switching default from more to less would have been hazardous, as even reading related documents and/or manpages is affected.
I think switching default from vi to ee would be much LESS hazardous, as everyone can read documents / manpages as usual and users of vi seems to be much, much more...
When you create a user account you have the option to populate the user's home directory with so-called skeleton files. Those live in /usr/share/skel on FreeBSD. If you used pw to create the user account:
-m This option instructs pw to attempt to create the user's...
Changing the default is going to confuse everyone even more, just look at the more -> less change. I'd vote for setting EDITOR in the dot.shrc skeleton file. And perhaps make it more visible in the man page this is an option you can change (only PAGER is mentioned in freebsd-update). Speaking of...
Note that EDITOR is set in the default ~/.cshrc but not in ~/.shrc. Either way, just adjust ~/.cshrc (if you're on csh) and/or add export EDITOR=ee to ~/.shrc if you're on sh.
This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
By continuing to use this site, you are consenting to our use of cookies.