Questions tagged [ash]

A shell(ash) written by Kenneth Almquist and released to the comp.sources.unix Usenet news group on May 30th 1989. It has features similar to the Bourne shell(sh). Its many derivatives include the system shell on; Debian (dash), FreeBSD (sh), NetBSD (sh) and the default shell in Busybox (ash).

189 questions
0
votes
0 answers

follow logfile with tail and exec on event

i wonder if there is a more simplyfied way to run the tail -f or -F on a logfile and execute a command each time a special keyword is mentioned. this is my working solution so far, but i don't like it for following reasons: i have to write new…
alecxs
  • 701
  • 8
  • 17
0
votes
0 answers

trouble executing SSH remote ash script on ESXI Host

I have two servers: Linux shell (192.168.1.11) and ESXI host ash shell (192.168.1.12). Desired outcome: Local testsuspend.sh scp uploads suspendvm.sh to remote ESXI server and executes on ESXI. When finished testsuspend.sh continues and…
Bubba
  • 1
  • 2
0
votes
1 answer

How can I skip the first argument in an ash/dash shell function?

In an ash/dash function, I can refer to the full parameter list like this: allparameters() { echo "$@"; } Which gives me: $ allparameters yyyyy abffcd efgh yyyyy abffcd efgh I want to skip yyyyy, so I tried ${@:2}: butlast() { echo "${@:2}";…
Aankhen
  • 2,198
  • 11
  • 19
0
votes
1 answer

How do I prevent ANSI escape key sequences from spamming display during read in bash/ash script?

I'm attempting to make a script that handles arrow keys on a very limited system with busybox ash and very little else. No stty for example. I have something that mostly works but occasionally some ANSI escape sequences show up on the screen. …
deeice
  • 3
  • 2
0
votes
1 answer

garmin connectciq-sdk ommand monkeyc not found in openjdk apline docker container

I'm running openjdk:13-alpine docker container and mounted the garmin connectiq-sdk files into the container. Trying to run monkeyc command fails with "not found". ~/projects/garmin$ docker container run --rm -it --name monkeyc -v…
veimis
  • 71
  • 1
  • 4
0
votes
0 answers

SHELL : concatenate variable name

I would like to concatenate the variable name with shell using the folowing example val=23 for i in 1 2 3 4 do a$i=$val + $i done but I got error -ash: a1=x: not found !! how can I concatenate variable name with shell the…
Anis_Stack
  • 3,306
  • 4
  • 30
  • 53
0
votes
1 answer

bish-bosh not running with "No such file or directory"

I wanted to run bish-bosh as a simple shell-based MQTT Client, so I downloaded the content of release_2015.0119.1445-1 and inited the submodules (11.3 MB of files). After chmod a+x bish-bosh I wanted to run it but... # ./bish-bosh ': No such file or…
Stefan
  • 197
  • 1
  • 11
0
votes
2 answers

ash: Remove last param

I'm in a busybox environment which only has sh and ash available. Now I'm doing a script in which I need to pass all but the last param to ln. So far it looks like this: #!/bin/ash TARGET="/some/path/" for last; do true; done ln $@…
MetalSnake
  • 277
  • 3
  • 14
0
votes
1 answer

Nesting for loop inside a while loop on one line

I am trying to run a script looping forever every ten seconds five times one second apart. How can I do this from command line instead of a script? This does not work: while true; do; sleep 10 && for i in `seq 3` do; sleep 1 && date; done;…
FoxSam12
  • 179
  • 1
  • 9
0
votes
2 answers

shell script for copying log files into a single compressed file

We have a folder in our embedded board "statuslogs", this folder contains logs which are of the format : daily_status_date_time.log. We need to get all the files of a particular year into a single file, for fetching from the server. We did the…
md.jamal
  • 4,067
  • 8
  • 45
  • 108
0
votes
1 answer

Command executed in busybox shell script gives no output

I boot my computer with initramfs that I have generated with gentoo genkernel. I now tweak and update initramfs filesystem and kernel by hand for more flexibility. I tried to update busybox as the newer version has more functionalities, from v1.20.2…
travonz
  • 1
  • 1
0
votes
0 answers

Shell (sh) script array

Have been trying to find away to do array in sh shell script. Other than BASH etc. have not found much, other than arrays not supported in sh. Here's what I've come up with using setvar and eval. Is there a better way? Any way to eliminate setvar…
NOYB
  • 625
  • 8
  • 14
0
votes
2 answers

how to get the value of the parameter with $@ in busybox shell

In a busybox shell script test.sh (not bash), if I pass 4 paramters into it, how can I get the value from each of them directly. for example #!/bin/sh args=("$@") param3=${args[2]} #I want to get the value of the parameter 3, it works in bash …
AllenHu
  • 561
  • 2
  • 5
  • 13
0
votes
5 answers

How to extract string between 2 xml tags?

I have a string like this my message How I can extract the message between the tags with sed or awk? So I get only "my message"
MOHAMED
  • 41,599
  • 58
  • 163
  • 268
0
votes
2 answers

Extract the first occurency of text between 2 patterns

I have a text file like this ----PAT1---- textaa1 textbb1 textcc1 ....... ----PAT2---- ----PAT1---- textaa2 textbb2 textcc2 ....... ----PAT2---- I want to extract the first text between "----PAT1----" and "----PAT2----" icluding both patterns So…
MOHAMED
  • 41,599
  • 58
  • 163
  • 268