ash

Android adb shell - ash or ksh?

最后都变了- 提交于 2019-11-30 09:13:08
The Android online documentation Android Debug Bridge says "Adb provides an ash shell". Sure enough, if I adb shell to an AVD emulator I get ash which is basically a cut-down Bourne shell. However, if I connect to a couple of remote devices, one an HTC telephone and the other an ASUS Transformer Prime tablet, they both have a version of the Korn shell, which gives: KSH_VERSION='@(#)MIRBSD KSH R39 2010/08/24' . Although MIRBSD KSH is not a full-blown AT&T Korn shell, it is still a lot more powerful than ash. The emulator is running Jelly Bean, and both devices are using ICS. Doing a bit more

How to get /etc/profile to run automatically in Alpine / Docker

☆樱花仙子☆ 提交于 2019-11-30 00:09:25
How can I get /etc/profile to run automatically when starting an Alpine Docker container interactively? I have added some aliases to an aliases.sh file and placed it in /etc/profile.d , but when I start the container using docker run -it [my_container] sh , my aliases aren't active. I have to manually type . /etc/profile from the command line each time. Is there some other configuration necessary to get /etc/profile to run at login? I've also had problems with using a ~/.profile file. Any insight is appreciated! EDIT: Based on VonC's answer, I pulled and ran his example ruby container. Here is

Android adb shell - ash or ksh?

丶灬走出姿态 提交于 2019-11-29 13:06:19
问题 The Android online documentation Android Debug Bridge says "Adb provides an ash shell". Sure enough, if I adb shell to an AVD emulator I get ash which is basically a cut-down Bourne shell. However, if I connect to a couple of remote devices, one an HTC telephone and the other an ASUS Transformer Prime tablet, they both have a version of the Korn shell, which gives: KSH_VERSION='@(#)MIRBSD KSH R39 2010/08/24' . Although MIRBSD KSH is not a full-blown AT&T Korn shell, it is still a lot more

【JVM学习笔记】类加载器

大城市里の小女人 提交于 2019-11-29 01:51:09
下图来自:http://blog.csdn.net/jiangwei0910410003/article/details/17733153 package com.test.jvm.common; import java.io.ByteArrayOutputStream; import java.io.File; import java.io.FileInputStream; import java.io.IOException; import java.io.InputStream; /** * 自定义的类加载器 */ public class MyClassLoader extends ClassLoader { private String name; //加载器的名字 // private String className; //被加载类的全名 private String path = "D:/workspace/eclipse-workspace64bit17-forPersonalProject/openbank-parent/openbank-test/src/test/java/"; //加载类的路径 private final String fileType = ".class"; //class文件的扩展名 public MyClassLoader

How to get /etc/profile to run automatically in Alpine / Docker

爱⌒轻易说出口 提交于 2019-11-28 21:04:43
问题 How can I get /etc/profile to run automatically when starting an Alpine Docker container interactively? I have added some aliases to an aliases.sh file and placed it in /etc/profile.d , but when I start the container using docker run -it [my_container] sh , my aliases aren't active. I have to manually type . /etc/profile from the command line each time. Is there some other configuration necessary to get /etc/profile to run at login? I've also had problems with using a ~/.profile file. Any

How to reverse a list of words in a shell string?

心不动则不痛 提交于 2019-11-26 20:56:15
问题 I have a list of words in a string: str="SaaaaE SeeeeE SbbbbE SffffE SccccE" I want to reverse it in order to get "SccccE SffffE SbbbbE SeeeeE SaaaaE" How I can do that with ash ? 回答1: You can use awk as follows: echo "$str" | awk '{ for (i=NF; i>1; i--) printf("%s ",$i); print $1; }' 回答2: Yes, you can try these commands, For string , echo "aaaa eeee bbbb ffff cccc"|tr ' ' '\n'|tac|tr '\n' ' ' For the variable , echo $str|tr ' ' '\n'|tac|tr '\n' ' ' 回答3: You could use awk: echo "aaaa eeee

What do $? $0 $1 $2 mean in shell script? [duplicate]

笑着哭i 提交于 2019-11-26 05:20:21
问题 This question already has an answer here: What are the special dollar sign shell variables? 4 answers I often come across $? $0 $1 $2 etc.... in shell scripting, what I know is that $? returns the exit status of the last command echo \"this will return 0\" echo $? but what do the others do? what are they called and is there more? perhaps like $3 $4 $5 ... 回答1: These are positional arguments of the script. Executing ./script.sh Hello World Will make $0 = ./script.sh $1 = Hello $2 = World Note