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...
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 "...
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...
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:
#!/...
Erbium asked 27/3, 2015 at 7:18
18
Solved
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...
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...
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...
1
Solved
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...
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...
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? ...
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...
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...
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...
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?
1
Solved
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 ...
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...
1
© 2022 - 2024 — McMap. All rights reserved.