Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [dash-shell]

Lightweight command-line shell, used as the default `/bin/sh` on Ubuntu

4
votes
1answer
44 views

update-alternatives for sh reports bash is used, but I still get dash

I just upgraded to Ubuntu 18.10 from Ubuntu 17.10. I have my box configured to use bash as the default shell rather than the default dash. I've made this change with sudo update-alternatives --...
0
votes
0answers
22 views

how to reinstall bin/dash on ubuntu 16.04

I accidentally delete the bin/dash file as I got confused with plotly's dash. As a result, I can no longer boot my computer. As I following this link:/bin/sh, /bin/bash and /bin/dash all broken, how ...
1
vote
1answer
37 views

I need to insert a large string in between two pattern using shell script

I have an HTML file in that I have a comment line as: <!-- tag1 --><!-- tag11 --> I need to insert a JQ file element in between them. I have tried and I was able to insert a small ...
0
votes
0answers
182 views

Illegal option when trying to run a shell script

I'm trying to daemonize Celery using this script and this doc. But when I run sudo /etc/init.d/celeryd start, I get a response /bin/sh: 0: Illegal option -. What am I missing here? I am very new to ...
1
vote
1answer
267 views

How Can I Make /bin/sh point to /bin/bash?

In Ubuntu, /bin/sh points to /bin/dash by default. I want to use /bin/bash as my system-wide shell for /bin/sh. What is the best way to do this?
4
votes
1answer
238 views

Are there concrete figures on the speed of bash vs dash?

According to this article, dash was chosen as /bin/sh because bash is slower: Dash as /bin/sh Are there concrete figures for how much faster dash is? How much longer does it take if you use bash ...
1
vote
1answer
28 views

Dash, command substitution not inserting newline?

Basically, this is the issue: $ echo Hello"$(printf '\n')"World HelloWorld What did I overlook ?
10
votes
2answers
1k views

How does ~/ work? [duplicate]

In the terminal, one way to reference home is by using ~/. I don't understand how this works, because the output of file ~/ is: /home/admin/: directory and just running ~/ results in: -bash: /home/...
4
votes
1answer
53 views

fc built in missing from dash ( i.e.,dash shell history doesn't work )?

In dash manual, under Builtins section there exists explanation on fc built in which controls shell history and re-executes commands from it, FCEDIT and HISTSIZE also are mentioned there. Yet when I ...
0
votes
0answers
44 views

Fish Shell Fatal Error : Not A Git Repository

I have been using Fish Shell for a while now, however, a day or two ago, this error started appearing on execution of every command within the shell: fatal: Not a git repository (or any of the parent ...
1
vote
1answer
77 views

reading values from properties.ini and getting file not found

I keep getting ./config.sh: line 5: .: properties_DEV.ini: file not found When running deployment.sh, I am not sure why, all three files are in the same directory. property file contains values, ...
0
votes
1answer
82 views

“globstar” equivalent in dash (Debian Almquist Shell)

I am using /bin/dash on a project, but I have need for **/filename.ext to have recursive behavior (i.e. globstar enabled in bash). Is globstar available in dash? Is there a similar feature or ...
3
votes
1answer
359 views

Ubuntu 17.10 partitions in dock

After installing ubuntu17.10 I was depressed by the fact that I can't add my partitions to the dock in order to easily mount and open them, I locked around on google, ubuntu forums and I got nothing, ...
0
votes
0answers
53 views

System not booting because of /sbin/init: Permission denied

How can I change root folder permissions in the built-in shell console? I am trying to repair Ubuntu, but it's giving permission denied issue while it's repairing. Boot Info Script 8f991e4 + Boot-...
10
votes
3answers
1k views

Why are numeric function names not allowed?

Consider the following: $ ksh -c '1(){ echo hi;};1' ksh: 1: invalid function name $ dash -c '1(){ echo hi;};1' dash: 1: Syntax error: Bad function name $ bash -c '1(){ echo hi;};1' bash: `1': not a ...
20
votes
4answers
5k views

What is the point of sh being linked to dash?

I am wondering what the point of sh being symbolic linked to dash is? I understand that dash is supposed to be faster than bash, but I am uncertain why the original sh shell isn't present in sh. Or ...
1
vote
1answer
78 views

Want to search occurance of “error” string in a log file except in some strings that has “error”(we should ignore these strings)

I want to search occurance of "error" in log file using if condition and print that error is present in log file. and if not present then should print no error found. The issue here is in my log file ...
0
votes
2answers
839 views

Encrypted System Partition Failed to Load on Ubuntu 17.04

I have a laptop (Thinkpad L520) with 256 GB SSD drive with Ubuntu 17.04 on it (no other operating system installed). The drive is encrypted with means of Ubuntu installation medium. One day the system ...
0
votes
1answer
128 views

What is an example of a generic shell script that will run correctly in the terminal but not when double-clicked?

I'd really like to understand the underlying reasons why some scripts work from the command line but not when double-clicked. Is there an example of a script that does something simple, like ...
5
votes
1answer
706 views

vi editing mode in dash ( /bin/sh ) [duplicate]

TL;DR : default shell man page says there's vi editing mode, but set -o vi doesn't actually enable it In many shells, including dash the POSIX standard dictates that set -o vi will enable vi editing ...
1
vote
1answer
57 views

How do I write a script to rename and move a video file?

On my media server I have files that I want to automatically move and rename after they have been watched (/NewEpisodes) I want to move those file after they have been watched to a new directory (/...
0
votes
2answers
395 views

How to run and where to save a downloaded package on Ubuntu?

There are two ways to download a package: GUI & CLI (via terminal). I tried the first one and can run the package via terminal only. I want the app to appear on Dashboard and also to be findable ...
-3
votes
1answer
57 views

Scripting a script that tests a shell [closed]

I have a custom shell and want to test its arithmetic function. I wrote a script to test it and it performs the arithmetic but it is also trying to execute the result as a program. printf "******...
0
votes
1answer
65 views

How can I make pasting work like yanking?

If I press ctrl+y (yank) in some programs, then the program will output what's in the clipboard to the current selected screen area. But why doesn't it work from the terminal? I would like a more ...
0
votes
3answers
942 views

string “if” statement comparing is string empty

I have problem checking if string is empty. I get first column of ls -l info and try to grep string searching for "x". If string is empty, I should countinue. But whenver string is empty or not, I ...
1
vote
2answers
2k views

/bin/sh, /bin/bash and /bin/dash all broken, how can I install them again

Removed all /bin/sh, /bin/bash and /bin/dash. I cannot install them because dpkg and apt-get need a shell to install and there is no shell available. I'm still logged in and my Ubuntu is still running....
7
votes
2answers
435 views

Line editing in dash

In bash or mksh it is possible to move around the typed line word by word, using shortcuts such as ESCB. That doesn't work in ksh or dash. As far as I understand from googling, this has something to ...
0
votes
1answer
239 views

Ubuntu internal error /bin/dash

I am getting this error every time I boot into Ubuntu. "Sorry, Ubuntu 14.04 has experienced an internal error" I am suspecting it to cause an annoying hanging of terminal applications when ...
3
votes
1answer
2k views

Dash is empty, applications do not appear

I use Unity on Ubuntu 14.04. In Dash, applications are not present. Folders&files and plugins are there though. I tried : unity --reset sudo apt-get purge unity-lens-applications unity-lens-...
1
vote
0answers
165 views

Equivalent of logname for profile

I'm getting an error when entering my session because I'm using logname in my .profile, and apparently Ubuntu doesn't like it. It says something along the lines of logname: login name not found I ...
0
votes
1answer
2k views

Terminal shows black screen Ubuntu 14.04

When I open the terminal in my Ubuntu 14.04 LTS, it shows a black window with no buttons. Nothing's visible, not even the minimise or close button. However all the commands that I type, work perfectly....
0
votes
1answer
983 views

Record screen at bootup using ffmpeg in 5 minute segments (12.04)

So I've played around with this quite a bit but at this point I've managed to hit a wall in figuring the next step. I have this script that works from an ssh tunnel to record display :0.0 #!/bin/...
3
votes
1answer
438 views

What's the difference between system shell and login shell?

I recently encountered that my /bin/sh is a symlink to dash, which is apparently default system shell for ubuntu since its 6.10 release. I didn't know system shell is different from login shell. I ...
1
vote
1answer
858 views

Solving $PATH obfuscation by /bin/sh (dash)

This question is a follow-up from https://unix.stackexchange.com/questions/126955/percent-in-path-environment-variable. I post it here, since it is more distro-specific. The shell used by default for ...
-2
votes
1answer
557 views

How to make a shell script pipe aware

I have the following script: #!/bin/sh [ "${#}" -eq "0" ] && (printf "%s\\n" "${0}: word ..." >&2; exit 1) _whats() { [ -z "${1}" ] && return 1 [ -z "${2}" ] &&...
0
votes
2answers
190 views

command line not working

after I initially installed ubuntu , I can run 'll' in my terminal. But after I checked a "Run command as login shell" in terminal preferences I cannot run "ll" command any more in terminal. ...
2
votes
0answers
740 views

How to make CFLAGS work with the dash shell?

My impression is that while setting the CFLAGS variable is effective when bash is the default shell, it doesn't make an effect with dash (the Debian Almquist shell). First of all please correct me if ...
9
votes
2answers
3k views

How to find the version of the Dash shell on Ubuntu /bin?

I would like to know if there is a way for find the shell Dash version. I tried several commands like : dash -v, dash -V, dash --version, but no one works. Dash Shell Wikipedia : http://en.wikipedia....
1
vote
2answers
3k views

Multiply with decimal numbers in bash [closed]

When i run p=0.1 k=2 while [ $p \< 1 ] do echo $p p=$(echo "scale=2; $p*$k" | bc) done i have this result 0.1 .2 .4 .8 What can i do to have 0.1, 0.2, 0.4 and 0.8 ?
2
votes
2answers
817 views

Run shell script downloaded from web

I have a .sh script (wget-20121105144134.sh) which I downloaded from the web. The script contains codes to download huge climate data files. Can you tell me how to run this file on Linux? It is easy ...
3
votes
2answers
8k views

How to replace/fix a messed up /bin/sh and /bin/dash

I have corrupted my /bin/sh and have no idea how to replace it. I accidentally copied over it. How can I fix this? I am running Ubuntu Server 11.10, no X. update: I have tried the fix that was ...
12
votes
3answers
7k views

How can my script determine whether it's being run by bash or dash?

I'm running a fresh Oneiric install (i.e. not an upgrade) on two different systems and running into the same set of seemingly related problems. The most frustrating of the bunch is that, when I use ...