ash

how to put all command arguments in one variable

僤鯓⒐⒋嵵緔 提交于 2020-01-23 12:04:10
问题 I want to execute a shell script that require 3 arguments. The argument number 2 contains a string with space I want to put all arguments in one variable like this: Linux:~# kk="\"111\" \"222 222\" \"333\"" Linux:~# echo $kk "111" "222 222" "333" Now If I call a function: func() { echo ---$1--- echo ---$2--- echo ---$3--- } with the $kk variable in this way func $kk Then it will return Linux:~# func $kk ---"111"--- ---"222--- ---222"--- And I was expecting to get this result ---111--- ---222

Ash Technologies Inspex HD 1080p Vesa ASH VISION 数字显微镜 Inspex HD 1080p Table高清晰相机

大城市里の小女人 提交于 2020-01-02 18:32:53
Ash Technologies Inspex HD 1080p Vesa ASH VISION 数字显微镜 Inspex HD 1080p Table高清晰相机 18016079478 2020.01.02 16:33:28 字数 494 阅读 0 Ash Technologies Inspex HD 1080p Vesa ASH VISION 数字显微镜Inspex HD 1080p Table高清晰相机。Ash Technologies omni core是一种高清摄像机检测系统,提供卓越的全1080p高清图像质量,色彩再现,对比度和分辨率。该模型包括用于检查和测量的表格。Ash Technologies omni core 集成的,实时的,在屏幕上的测量网格和光标提供了一个简单而有效的方法来测量没有电脑。 宽动态范围根据每个像素的饱和度级别使用重叠的多重曝光。 降噪可以消除噪点,从而提供更清晰的图像。 可拆卸USB存储图像捕获。现在,您可以将图像直接存储到USB存储设备。只需将设备插入Inspex HD 1080p USB端口即可。 屏幕显示提供重要信息,如放大级别,聚焦/曝光模式和深度设置菜单。 白平衡是指确保白色在图像中显示为白色的过程。这将有助于消除来自各种光源(太阳,白炽灯泡和荧光灯泡)的色偏。 桌面区域和可调节臂使其非常适合返工和修理。 Inspex

Docker Alpine linux running 2 programs

夙愿已清 提交于 2019-12-29 07:11:58
问题 I am trying to create docker image with alpine linux, which after run will create container with 2 running programs. This 2 (in my opinion - I don't know docker well) can't be separated because first program changes the seconds configuration file and then should restart that program too. I am struggling how to run both programs. I have added own script which should run that programs but I am missing something - script is 2 lines on each line is command for running that program - and it only

Can't increment a 0-padded number past 8 in busybox sh

南笙酒味 提交于 2019-12-23 04:24:26
问题 this is the code I am using to save files from a camera and name them from 0001 onward. The camera is running Busybox, and it has an ash shell inside. The code is based on a previous answer by Charles Duffy here. #!/bin/sh # Snapshot script cd /mnt/0/foto sleep 1 set -- *.jpg # put the sorted list of picture namefiles on argv ( the number of files on the list can be requested by echo $# ) while [ $# -gt 1 ]; do # as long as there's more than one... shift # ...some rows are shifted until only

How to match regexp with ash?

时光总嘲笑我的痴心妄想 提交于 2019-12-21 19:28:24
问题 Following code works for bash but now i need it for busybox ash , which apparrently does not have "=~" keyword="^Cookie: (.*)$" if [[ $line =~ $keyword ]] then bla bla fi Is there a suitable replacement ? Sorry if this is SuperUser question, could not decide. Edit: There is also no grep,sed,awk etc. I need pure ash. 回答1: For this particular regex you might get away with a parameter expansion hack: if [ "$line" = "Cookie: ${line#Cookie: }" ]; then echo a fi Or a pattern matching notation +

How does ash files are structured?

跟風遠走 提交于 2019-12-13 16:14:43
问题 I have a small distro (not busybox) that uses ash, and I am not sure how the dot file structure is handled. .ashrc doesnt seem to be picked up nor I see a .bash_profile analog. Is there a default convention for shell startup file? 回答1: This is covered in the Invocation section of the man page. ~/.profile is read for login shells. For non-login interactive shells to read a dotfile at startup, you need to in your environment (ie. set by .profile ) specify the name of a file to read in ENV .

Turning a bash script into a busybox script

点点圈 提交于 2019-12-12 03:30:05
问题 I am working on a device that only has busybox (ash?) and does not support bash. However, I need to run the bash script below on it. Is it possible or busybox simply does not support scripts? #!/bin/bash domain="mydomain.com" record="11019653" api_key="key1234" ip="$(curl http://ipecho.net/plain)" echo content="$(curl \ -k \ -H "Authorization: Bearer $api_key" \ -H "Content-Type: application/json" \ -d '{"data": "'"$ip"'"}' \ -X PUT "https://api.digitalocean.com/v2/domains/$domain/records/

regexp error when filtering command output

家住魔仙堡 提交于 2019-12-11 17:48:39
问题 I want to filter the lines from the following command: $ cat /proc/net/route Iface Destination Gateway Flags RefCnt Use Metric Mask MTU Window IRTT br-lan 01020300 C0A80101 0003 0 0 3 FFFFFF00 0 0 0 br-lan 03043836 C0A80101 0007 0 0 5 FFFFFFFF 0 0 0 br-lan C0A80100 00000000 0001 0 0 0 FFFFFF00 0 0 0 I want to extract only the line containing the Destination 01020300 and the Mask FFFFFF00 I tried with the following regexp but it does not works cat /proc/net/route | grep "[^ \t\v]\+[ \t\v]\+

How to extract a part of string?

半城伤御伤魂 提交于 2019-12-11 15:47:45
问题 I have string contains a path string="toto.titi.1.tata.2.abc.def" I want to extract the substring which is situated after toto.titi.1.tata.2. . but 1 and 2 here are examples and could be other numbers. In general: I want to extract the substring which situated after toto.titi.[i].tata.[j]. . [i] and [j] are a numbers How to do it? 回答1: You can use cut echo $string | cut -f6- -d'.' 回答2: Pure bash solution: [[ $string =~ toto\.titi\.[0-9]+\.tata\.[0-9]+\.(.*$) ]] && result="${BASH_REMATCH[1]}"

how to put all command arguments in one variable

不羁岁月 提交于 2019-12-06 12:29:23
I want to execute a shell script that require 3 arguments. The argument number 2 contains a string with space I want to put all arguments in one variable like this: Linux:~# kk="\"111\" \"222 222\" \"333\"" Linux:~# echo $kk "111" "222 222" "333" Now If I call a function: func() { echo ---$1--- echo ---$2--- echo ---$3--- } with the $kk variable in this way func $kk Then it will return Linux:~# func $kk ---"111"--- ---"222--- ---222"--- And I was expecting to get this result ---111--- ---222 222--- ---333--- How to solve this issue without using eval ? I know that the eval solve this issue but