[Solved] Question about ash vs bash in openwrt

Hallo Forum,

I have a question about ash shell in openwrt.
In a normal linux such as Ubuntu or Mint, I have my bashrc file which holds like link to my own personal .my_bash_aliases in which I edit my own personal alias tools.
I would like to do the in openwrt, however since the file structure is very different to a normal linux system.
How can I implement this ?
Do I need to install the bash shell ?

thx, user4747

for openwrt.
that be the line.

        done
        unset FILE
}

where the 

 $HOME/.profile
``` needs to go ?
even if there is no /home directory ?

try echo $HOME when logged in.

yeah I got that bit, sorry I am not familiar echo commands.
I added line, and looks like this now. hope this correct.

 done
        $root/.profile
        unset FILE

that shouldn't work, unless $root has a value.

I fixed to

/root/.profile

and when I log back in I get the following error msg
-ash: /root/.profile: Permission denied

can't reproduce it

root@OpenWrt:~# pwd
/root
root@OpenWrt:~# cat .profile
echo "hello!"
root@OpenWrt:~# ls -la .profile
-rw-r--r--    1 root     root            14 May  7 09:24 .profile
root@OpenWrt:~#
 OpenWrt 23.05.3, r23809-234f1a2efa
 -----------------------------------------------------
=== WARNING! =====================================
There is no root password defined on this device!
Use the "passwd" command to set up a new password
in order to prevent unauthorized SSH logins.
--------------------------------------------------
hello!
root@OpenWrt:~#

I get the same result for my file

-rw-r--r--    1 root     root            36 May  7 11:17 .profile

I wound what the cause might be...?

the content ... ?

probably

ENV=$HOME/.ashrc; export ENV
. $ENV

maybe I need to change $HOME to /root

no that did not help either

why are you referencing another rc file in a rc file ?

I probably misunderstood your notes.
should I change

ENV=$HOME/.ashrc; export ENV
to
ENV=$HOME/.myashrc; export ENV

?
and place a test alias in there ?
such as

alias p9='ping 9.9.9.9'

they weren't my notes, and you didn't read the linked page carefully enough.

sorry about that.
that leads me to another question though.
in busybox I couldn't find any command to add new user's.
even though most official doc's outside of the openwrt community say that busybox should have have such commands built in.
two questions:
in order to get my aliases working do I need to add a new user ?
If yes, how do I do that in openwrt ?

I doubt it

image

works like a charm, like I said, check your content.

root@OpenWrt:~# cat .profile
alias p9='ping 9.9.9.9'
root@OpenWrt:~#
in order to prevent unauthorized SSH logins.
--------------------------------------------------
root@OpenWrt:~# alias
p9='ping 9.9.9.9'
ll='ls -alF --color=auto'
more='less'
vim='vi'
root@OpenWrt:~# p9
PING 9.9.9.9 (9.9.9.9): 56 data bytes

hi @user4747

for your default user named 'root', you need to place .profile file in /root/ directory

here is example
cat /root/.profile

alias lrs='logread | grep -E "daemon.info\s[A-Z_]+:\s"'
alias lr0='logread | grep wlan0'
alias wi0='iwinfo phy0 freq && iwinfo phy0 txp'
alias lr1='logread | grep wlan1'
alias wi1='iwinfo phy1 freq && iwinfo phy1 txp'
alias lrw='logread | grep wlan'
alias hw='cat /tmp/sysinfo/model'
PS1='\[\e]0;\u@\h: \w\a\]\u@\H:\w\$ '

and permissions ...
ls -la /root/

drwxr-xr-x    2 root     root            31 Apr 30 23:38 .
drwxr-xr-x    1 root     root             0 May  5 08:02 ..
-rw-rw-r--    1 root     root           322 Apr 30 23:38 .profile

the .profile is located in /root folder
here is the content

-ash: /root/.profile: Permission denied
root@OpenWrt7632:~# ls -al /root/
drwxr-xr-x    1 root     root           360 May  7 11:55 .
drwxr-xr-x    1 root     root           544 Jan  1  1970 ..
-rw-r--r--    1 root     root             0 May  7 11:55 .ashrc
-rw-r--r--    1 root     root            36 May  7 11:54 .profile
drwx------    2 root     root           232 May  6 17:32 .ssh

that's not the content, that's a file list.