Questions tagged [dash-shell]

A POSIX-compliant shell implementation that aims to be as small as possible. Please use the [hyphen] tag instead of [dash] if your question is about the "-" character.

The Debian Almquist shell (dash), a modern replacement for , is a POSIX-compliant Unix shell. It requires less disk space than , for example, but it is also less feature-rich.

Resources

151 questions
0
votes
1 answer

dash on alpine linux (in docker)

I'm trying to install dash in the (dockerized) alpine linux. My Dockerfile follows: FROM alpine:latest RUN \ echo "@community http://dl-cdn.alpinelinux.org/alpine/edge/community" >> /etc/apk/repositories && \ apk add --no-cache --update…
Peter Butkovic
  • 11,143
  • 10
  • 57
  • 81
0
votes
1 answer

Makefile convert files in current directory

I'm trying to convert all .txt with a script to a different format. I'm allowed to use shell commands just for the targets, but I'm not allowed to use loops... BTW I have to use the dash interpreter. The script is called txtConverter. It reads txt…
homior
  • 161
  • 1
  • 12
0
votes
1 answer

Name variable from string in Dash

I need to set a variable name from a string. Here is my code : var="cle" value="1" printf -v $var "$value" echo $cle I want it to output "1" I am getting: illegal option "-v" I tried to replace printf by the declare function but, dash doesn't…
DevNico
  • 3
  • 2
0
votes
2 answers

How to run "rm -rf !(folder)" in dash

I've written a deployment plan in Bamboo, which runs all the scripts on an agent using sh, and since those agents run ubuntu 14.04 that equates to dash. I want to do the following step: rm -rf !(${bamboo.scripts_folder}) This should remove all the…
Rumbles
  • 1,367
  • 3
  • 16
  • 40
0
votes
2 answers

Editing the output in a pipeline

I encountered a problem while writing my bash script cutfiles=`find $DIR -type f | file -b $SAVEFILES | cut -c1-40 | sort -n | uniq -c | sort -nr | head -10 | while read -r n text; do printf " …
Adam
  • 99
  • 2
  • 8
0
votes
2 answers

Print variables with number of iteration index in dash

I work in dash and I would like to know if there is any method to print variable with index of number of iteration. CODE : var1="a" var2="b" var3="c" tmp=0 while [ $tmp -lt 4 ] do # this is how i imagine it echo $('var'$tmp) #output…
SevO
  • 303
  • 2
  • 11
0
votes
3 answers

How to access the prefix when using uniq -c

I encountered a problem in my program. I have a list of files and I sort them with this code to find out the 10 most frequent file types in the list. find $DIR -type f | file -b $SAVEFILES | cut -c1-40 | sort -n | uniq -c | sort -nr | head -10 My…
Adam
  • 99
  • 2
  • 8
0
votes
1 answer

Kill background process on SIGINT

I have this script, which should start a keep-alive script and Sublime Text 3 under Bash for Windows: #!/bin/dash set -e # Keep alive (in background) tail -f /dev/null & pid=$! echo "tail process id: ${pid}" echo "Keep-alive process started with…
Lanti
  • 2,299
  • 2
  • 36
  • 69
0
votes
1 answer

Is there a concise way to substitute return value of a function?

I'm putting together some unit tests for a dash shell script I've inherited and, given the large number of tests we want to add, I want to keep them as concise as possible. To do this, I've added a check helper function to handle pass or failure of…
paxdiablo
  • 854,327
  • 234
  • 1,573
  • 1,953
0
votes
1 answer

Bash/Dash: Process killed on "fi" in an "If then else" statement?

I have the following script which is creating SQL dumps out of my mysql database. The files are then historized by git. In this script I encounter a strange behaviour which I am -even with some research- not able to answer. If I run the script I…
Joerg
  • 9
  • 4
0
votes
1 answer

I got this error output when I type 'make' to compile the 'dash-to-dock'

msgfmt -c po/de.po -o po/de.mo make: msgfmt: No se encontró el programa Makefile:51: recipe for target 'po/de.mo' failed make: *** [po/de.mo] Error 127 can someone help me?
dashboy
  • 1
  • 1
0
votes
1 answer

Dash, is there any limitation on filepath

I have an executable which is placed on my Linux machine such that the length of the path to the executable is 107 characters. I found number of characters using command echo -n "/path/to/the/executable" | wc -c -m. When I try to execute the…
Gunjan Aggarwal
  • 710
  • 5
  • 19
0
votes
0 answers

How to build dash with CMake?

I'm trying to build dash using Clion and CMake but I get this build error: /opt/clion-2016.1.1/bin/cmake/bin/cmake --build /home/dac/.CLion2016.1/system/cmake/generated/dash-46b33cad/46b33cad/Debug --target all -- -j 4 [ 3%] Building C object…
Niklas Rosencrantz
  • 25,640
  • 75
  • 229
  • 424
0
votes
1 answer

SHELL Sorting output alphabetically

I have a script with output for example a c d txt iso e z I need to sort it alphabetically. These are file extensions so I cant compile it together in one word and then split up. Can anyone help me?
Johnczek
  • 532
  • 9
  • 30
0
votes
1 answer

Allow shell script to modify only containing directory

I am writing a posix compliment shell script that will, amongst other things, clone a git repository and then execute a script (that was cloned along with the repository) inside the repository. For example: git clone…
supercrabtree
  • 70
  • 1
  • 5