ash Questions

4

Solved

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 re...
Technicality asked 9/1, 2014 at 2:58

1

I've been reading the man pages for apk add, but I don't fully understand how to use the --force-broken-world flag. I was trying to install Python 2.7.6 into an Alpine image, but I got the followi...
Allix asked 5/2, 2018 at 17:52

4

Solved

I'm looking to run a command a given number of times in an Alpine Linux docker container which features the /bin/ash shell. In Bash, this would be bash-3.2$ for i in {1..3} > do > echo "...
ash
Furr asked 28/1, 2022 at 21:20

2

Solved

To replace substring in the bash string str I use: str=${str/$pattern/$new} However, I'm presently writing a script which will be executed with ash. I have a string containing '/' and I want to...
Antirachitic asked 20/2, 2014 at 15:51

2

Solved

For some reason, I can't use bash to build my script, the only way to do it is with ash, I have this sms auto responder script, each reply must be at max 160 chacters long, it looks like this: #!/...
ash
Erbium asked 27/3, 2015 at 7:18

18

Solved

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?
Starlight asked 30/12, 2014 at 10:31

9

Solved

I have this script: #!/bin/sh while [ true ] ; do urlfile=$( ls /root/wget/wget-download-link.txt | head -n 1 ) dir=$( cat /root/wget/wget-dir.txt ) if [ "$urlfile" = "" ] ; then sleep 30 con...
Humanism asked 24/12, 2014 at 9:37

1

The ash shell in busybox doesn't seem to implement any of the standard ways to get the filename that's being sourced. For instance: testo: #!/usr/bin/env -S busybox ash echo hello whorl echo using...
Augustina asked 11/2, 2022 at 18:6

4

Solved

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 s...
Scaly asked 25/6, 2016 at 1:39

5

How does one reboot from an ash shell? I have an Ubuntu system that is currently bricked for some reason (not pertinent for this question), which means I boot into a BusyBox ash shell. But t...
Propman asked 7/5, 2012 at 13:18

1

Solved

I wanted to change current directory into shell script into directory, containing specific regular file. I found that following trick works in mksh and busybox sh: path=/path/to/regular/file cd $p...
Humes asked 14/6, 2020 at 3:2

1

I need to SSH to an embedded device, launch a background program, then disconnect and keep the background process running. The problem is that the embedded device is using the ash shell (NOT bash o...
Seidule asked 17/4, 2015 at 16:11

3

Solved

I have the following file linux$ cat test.txt toto titi tete tata Saving the cat output into a variable will discard the newlines linux$ msgs=`cat test.txt` linux$ echo $msgs toto titi tete tat...
Rotate asked 2/8, 2013 at 13:40

2

Solved

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 fir...
Mayfly asked 3/3, 2018 at 23:47

1

Solved

I'm trying to use an alias in a shell script I'm writing, but it is not working. The alias: alias ts="awk '{ print strftime(\"[%Y-%m-%d %H:%M:%S]\"), \$0 }'" When I run the script, I get the fo...
Greenshank asked 16/11, 2017 at 13:54

2

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? ...
Kendall asked 25/3, 2015 at 14:33

2

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 22...
Mako asked 16/2, 2015 at 13:48

3

I have a program running on linux This program take its input from the stdin So I can launch it with input file in this way myprogram < file in order to avoid typing input to the program N...
Phira asked 29/4, 2014 at 9:54

1

Solved

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. Howeve...
Laure asked 14/8, 2012 at 10:13

3

Solved

I want to check if a function exist or not before executing it in the shell script. Does script shell support that? and how to do it?
Catalan asked 31/7, 2013 at 13:42

1

Solved

The new line \n is not taken account in the shell strings: str="aaa\nbbbb" echo $str Output: aaa\nbbbb Expected result: aaa bbbb How can I add a new line in the string?
Correll asked 30/7, 2013 at 15:8

2

Solved

this question is not the same as Does the shell support sets? i know lots of script language support list structure, such as python, python, ruby, and javascript, so what about linux shell? does ...
Proclus asked 7/9, 2012 at 10:20

2

I know this question has already been asked but no of the solution I've found worked for me! I have a program that has an output like this: COUNT|293|1|lps I'm interested in having the second fi...
Drugge asked 26/1, 2012 at 13:22
1

© 2022 - 2024 — McMap. All rights reserved.