richardtoohey2, yes i know that, I'm ok with that, my issue is that the SH shell never reads its startup configs. So basically whatever I put in
/root/.shrc or /root/.profile stays completely ignored.
Thank you. Yes, the .shrc is invoked in the .profile file.
Yes it is now. I had deleted the line last night, and today, after I re-entered the alias, it is working. It could have been the missing " ' " although I hadn't copied and pasted the line of text because I'm in a VM and clipboard...
That's a reference to ~/.profile:
# set ENV to a file invoked each time sh is started for interactive use.
ENV=$HOME/.shrc; export ENV
When executing alias alone in the shell, is the mc alias listed?
Yes, I did logout/in (as well as restarting).
I am wondering if lines 4 and 5 of the .shrc are involved in this:
This file will be used if the shell is invoked for interactive use and the environment variable ENV is set to this file.
Then it says see sh(1) and environ(7), but that didn't help me.
The alias itself looks good. The second one is missing a closing single quote.
Did you logged out and logged in so the shell can re-read it's .shrc for the alias to take effect?
Alternatively source sh configuration file without logging out/in.
. .shrc
rc.conf is not meant to set aliases...
...complaint. I am trying to make an alias so I don't have to type out the env thing, but I can't get the alias work. I put the alias in root's .shrc file. I also tried putting it in /etc/rc.conf. I tried it two ways:
alias mc='env SHELL=/usr/local/bin/bash mc'
and then with a made-up name...
...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've added these lines to /home/marietto/.shrc
export XDG_CONFIG_HOME="$HOME/.config"
export XDG_CACHE_HOME="$HOME/.cache"
export XDG_DATA_HOME="$HOME/.local/share"
export QT_QPA_PLATFORMTHEME=qt5ct
and this is what happened :
Now I can't login inside the vm anymore.
...going back to 'parent'
# echo $FOO
BAR
# export FOO
# sh
# echo $FOO
BAR
#
If you want to "save" that variable you need to add it to ~/.shrc, it's one of the scripts that get started each time you start a sh.
Invocation
If no arguments are present and if the standard input of...
In ~/.shrc set HISTFILE to an empty string does the job.
HISTFILE=
HISTSIZE=50
FCEDIT=vi
You can then delete your old history file ~/sh_history, it won't be created anymore.
From man sh(1):
With the setting above you still can access your current session history with history command(which...
...export PATH
TERM=${TERM:-xterm}
export TERM
PAGER=less
export PAGER
ENV=$HOME/.shrc; export ENV
if [ -x /usr/bin/resizewin ] ; then /usr/bin/resizewin -z ; fi
%
(Generally, very little of interest, because (off topic) sh is not my preferred shell.)
I'd like to tidy up my ~/.shrc and in the process was wondering what sort enhancements people have made to the file provided in a default configuration.
Add to the .shrc file in your home, the line:
alias clear="printf '\033\143'"
I'll put the post as resolved. This was the best solution I found, it is very quick. I chose the word "clear" because it's easy to remember, but you can use any word!
Thank you all!
I don't use Midnight commander but eventually you can add a shell function in your file ~/.shrc to accomplish it.
hist() {
local t f
t=$(mktemp)
f=$(mktemp)
fc -l 1 50 | tee $t
awk '{print substr($0, index($0, $2))}' $t | tee $f
less $f
rm -f $t $f
}
Do not forget to source your ~/.shrc file...
...Python venv.
All good apart when i go to root shell it shows me different PS1 which never was modified. Same on laptop.
My PS1 line in root`s .shrc
PS1="\u@\h:\w \\$ "
but my terminal prompt looks like this:
and my .zsh prompt loks like this:
Im using
.xinitrc to start my WM but before...
In my case the variable HISTSIZE is defined in the file ~/.shrc just like FCEDIT.
Like this for example:
HISTSIZE=50
export HISTSIZE
FCEDIT=vi
export FCEDIT
Then fc will 'remember' your last 50 commands passed in the terminal.
The trick is when invoked without range like this fc -l, only the...
...files. All of those dot files are copied in every users home directory by adduser and pw useradd.
/usr/share/skel/dot.cshrc
if ($?prompt) then
set prompt = "%N@%m:%~ %# "
set promptchars = "%#"
/usr/share/skel/dot.shrc
# set prompt: ``username@hostname:directory $ ''
PS1="\u@\h:\w \\$ "
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.