The log of mksh adapting

The log of mksh adapting

mksh development/adapting

Since the ubuntu is not support Chinese, there comes the English.The article is maily about the development log of mksh adapting.

log

  1. no controlling tty , kernel do not have a /dev/tty;To avoid some internal error or the runtime err log “no controlling tty”, I using -DMKSH_DISABLE_TTY_WARNING when build mksh.So it is not recommanded to do tty_init_fd in runtime mksh.
./sh.h:2751:extern int tty_init_fd(void);	/* initialise tty_fd, tty_devtty */
./jobs.c:1910:	switch (tty_init_fd()) {
./main.c:1189:tty_init_fd(void)
./var.c:1690:	if (tty_init_fd() < 2) {

and, tty_devtty is false, the infect is not clear!, see as below

jobs.c:351:		if ((ttypgrp_ok = (use_tty && tty_fd >= 0 && tty_devtty))) {

2.“turn job control on or off according to Flag(FMONITOR)”
[2021/06/02]
mkshrc的作用和openharmony适配
由于openharmony打算使用mksh+toybox作为shell和命令集,众所周知,toybox的命令执行格式为

toybox ls
toybox ifconfig
toybox ping
...

上述输入一定会逼疯用户。那么有常见的两种方式,来减少上述困扰。

  • 创建bin/ls软连接,指向toybox。
  • 创建alias别名命令,如alias ll='toybox ls -l --color'

但是,不幸的是,liteos_a当前并不支持软连接。那么alias还是可以继续解决问题,对于liteos来说,mksh已经被阉割掉脚本能力或者说liteos无法完美支持mksh的脚本能力。那么批量的alias将由谁来执行,需要将alias命令保存在哪里呢?
对比linux,bash每次启动都会执行一个文件,叫bashrc。mksh有没有类似的操作呢。通过源码阅读,发现了类似的文件dot.mkshrc。
今天就来研究,这个文件是否能满足我们的诉求,从而给liteos提供更加简洁易用的shell。

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值