FORUMS

Top Forum Discussions

[Shell][mksh][Scripting]::mksh-R50e-static-FULL+mkshrc_mods:::

309 posts
Thanks Meter: 457
 
By 7175, Senior Member on 2nd June 2014, 11:14 PM
Post Reply Subscribe to Thread Email Thread
22nd April 2015, 07:52 PM |#21  
moonbutt74's Avatar
Senior Member
Thanks Meter: 1,180
 
More
7,

This thread is awesome ! I don't know how i missed this.
O.T. if you've got time and via pm i was wondering if you've done any work with multi-call binaries
and could help me out on the basics or link me to good straightfoward tuts?

thanks

m
 
 
22nd April 2015, 08:51 PM |#22  
quasiperfect's Avatar
Junior Member
Thanks Meter: 0
 
More
Tutorial Where's best place for Vim runtime files?
Hey 7175. Thanks for the ridiculously easy way to run vim as root. Is there a recommended directory for the vim run-time files?
23rd April 2015, 08:51 AM |#23  
mirabilos's Avatar
Member
Thanks Meter: 15
 
Donate to Me
More
Quote:
Originally Posted by moonbutt74

O.T. if you've got time and via pm i was wondering if you've done any work with multi-call binaries and could help me out on the basics or link me to good straightfoward tuts?

I have a dislike for “tutorials”, they tend to skim over details and be wrong in parts.

I’ve done extensive work making making multi-call binaries easy in MirBSD (the code we inherited from OpenBSD for it was ugly), using features of newer GNU binutils versions.

If you want, come to #MirBSD on irc.freenode.net for talk. I don’t do the “web” PM thing if I can avoid it. eMail works, too… miros-discuss at the mirbsd domain dot org is the way to go (public mailing list).
The Following 2 Users Say Thank You to mirabilos For This Useful Post: [ View ]
7th August 2015, 06:06 PM |#24  
moonbutt74's Avatar
Senior Member
Thanks Meter: 1,180
 
More
@mirabilos

hi, quick question, in mkshrc i want to set prompt to display <user@current_mksh_version>
i know i can do it by echo but if i change mksh version the echo will be wrong, what's the correct $<env_variable>

Is there a way to blend the file command into mksh?

thanks

also on aliases i would like to set ln and ls and mount to use busybox if present @ /where/ever
how do i write that out? does bash like scripting do it like
Code:
if [ -e /system/xbin/busybox ]
then
\alias ls=ls
else
\alias ls=/system/xbin/busybox ls
fi
m
Last edited by moonbutt74; 7th August 2015 at 06:14 PM.
8th August 2015, 03:25 PM |#25  
mirabilos's Avatar
Member
Thanks Meter: 15
 
Donate to Me
More
Angry
Quote:
Originally Posted by moonbutt74

hi, quick question, in mkshrc i want to set prompt to display <user@current_mksh_version>
i know i can do it by echo but if i change mksh version the echo will be wrong, what's the correct $<env_variable>

It's $KSH_VERSION, you could do it like this:

Code:
x=${KSH_VERSION#*KSH }
x=${x%% *}
After this, $x contains (for example) "R51".

Quote:
Originally Posted by moonbutt74

Is there a way to blend the file command into mksh?

You mean the one that says if a file is data, executable, script, etc? No, you'd have to install that, and its data files, separately.

Quote:
Originally Posted by moonbutt74

also on aliases i would like to set ln and ls and mount to use busybox if present

You were pretty close, I'd write it like this, relying on $PATH, though:

Code:
if whence -p busybox >/dev/null; then
        \alias ls='busybox ls'
fi
No need to alias ls to ls if not. If you want to add default options to both:

Code:
if whence -p busybox >/dev/null; then
        \alias ls='busybox ls -F'
else
        \alias ls='ls -F'
fi
Good luck with your endeavours!
The Following User Says Thank You to mirabilos For This Useful Post: [ View ]
Post Reply Subscribe to Thread

Tags
busybox, grep, ksh, mksh, shell
Previous Thread Next Thread
Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes