Questions tagged [mksh]

MirBSD Korn shell, or mksh, is a Free command interpreter (shell) intended for both interactive and shell script use. `mksh` is the default shell on Android, some BSDs and some Embedded Linux distributions, and it is available for most other operating systems. Please use the “ksh” tag for generic Korn Shell questions, and the “mksh” tag (additionally) if your question targets mksh specifically.

Filter by
Sorted by
Tagged with
2
votes
4answers
84 views

What shells support “value substitution” like MirBSD Korn Shell?

On Android (which uses mksh, MirBSD Korn Shell), there's a special syntax of string substitution (called "value substitution"): ${|commands} Instead of collecting output of the commands (as ...
1
vote
1answer
81 views

Is it possible to make mksh use the tilde (~) for home in the PS1?

for example, instead of displaying user@hostname:/home/user in the prompt as per the example in the manpage, could one make mksh display user@hostname:~ ?
0
votes
0answers
17 views

how to get mksh to save time-stamps in history?

I set HISTFORMAT and that doesn't work. I also searched the man page for HIST, only HISTFILE and HISTSIZE show up.
3
votes
3answers
11k views

How to enable ksh command history between sessions

If I start ksh or mksh, my upwards arrow does nothing: $ ksh $ ^[[A^[[A^[[A^[[A^[[A But it works with bash if I start bash and press the upwards arrow. $ bash developer@1604:~$ ssh root@127.0.1.2 -...
1
vote
1answer
70 views

Is there a way to localize variables to the current function in `mksh` but not to others?

Is there a way for $val to be set in a () but not be seen by b ()? set -u -e -o pipefail a () { local +x val="myval" echo "in a: VAL= $val" b } b () { echo "in b: VAL= $val" } a Produces: ...
5
votes
2answers
929 views

How do you implement process substitution (using a bash script) in a shell that doesn't have it?

I've seen Fish shell implement process substitution as a function: # === Fish shell lang: function psub mkfifo $the_pipe cat >$the_pipe & echo $the_pipe # remove pipe when bg job ...
0
votes
1answer
658 views

mksh complete when moving to parent directory

I just installed the mksh and don't know how to solve one litte problem I have. When trying to change directory to the parent directory mksh does not complete when pressing "tab". Let me visualize: $ ...
2
votes
1answer
472 views

Is it possible to get working history for multi-line commands in mksh, using vi editing mode?

On my Debian systems, I have always used pdksh as my interactive shell. Originally, command-line history behavior was similar to what I grew up with on platforms like AIX and Solaris. Recently, ...
1
vote
1answer
1k views

How to make mksh for loop go from 1 to N [duplicate]

So I've tried to do this for x in {1..7000} do echo $x done The output is {1..7000} I've also learned that the C-style for loop doesn't work in mksh I've done a bit of googling but mostly ...
12
votes
4answers
5k views

Where are zsh and mksh incompatible with bash?

To what extent can other POSIX-compatible shells function as reasonable replacements for bash? They don't need to be true "drop-in" replacements, but close enough to work with most scripts and support ...
2
votes
1answer
2k views

Get the last executed command line in ksh

Is there a way to get the last executed command possibly together with the arguments within a ksh script? I am using mksh with cygwin. I tried fc -nl -1, but the script throws a "“fc: history ...
1
vote
1answer
997 views

Variable name completion in ksh

While I am in bash , I am able to do a tab complete with environment variable names, but with ksh I am not able to do so. How can I get it done with KSH? I am using mksh with cygwin.