Last call to make your voice heard! Our 2022 Developer Survey closes in less than a week. Take survey.

Questions tagged [dash-shell]

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

Filter by
Sorted by
Tagged with
1 vote
1 answer
49 views

is changing symlinks for "linux from scratch" harmful?

I started linux from scratch for educational purpose. In preparing section it says: Bash-3.2 (/bin/sh should be a symbolic or hard link to bash) Bison-2.7 (/usr/bin/yacc should be a link to bison or ...
user avatar
  • 33
1 vote
0 answers
291 views

Is there a startup file for dash not bash?

I put alises to .bashrc file however it doesnt sourced when it comes to /bin/sh which is linked to dash shell. Is there a compatiable version of sh terminal startup file for dash. I have tried ....
user avatar
  • 11
0 votes
1 answer
68 views

i want create shell script file

I want create shell script file in first line i want take PID for process by this command netstat -nlp | grep :3306 in second command i want kill process by kill $(PID) but i am find this error when ...
user avatar
0 votes
0 answers
165 views

How to fix "set -e -o pipefail" (CentOS script) for Ubuntu 18.04 LTS?

I'm working with a set of scripts that automate some bioinformatics (mitoVGP; https://github.com/VGP/vgp-assembly/tree/master/mitoVGP) and then the install is done as a conda environment. The problem (...
user avatar
0 votes
0 answers
65 views

Does POSIX shell (dash) officially support named character classes?

I know bash supports the so-called "named character classes" of patterns, such as [:alnum:], [:alpha:], [:ascii:] and [:digit:], but what about POSIX shell (typically dash in Ubuntu)? At ...
user avatar
  • 63
3 votes
1 answer
939 views

What are syntax differences between bash and dash?

I just realized that in current Ubuntu version /bin/sh is no more symlinked to bash (as it used to be for many years), but to dash instead. I wonder what are the actual syntax differences between ...
user avatar
  • 6,515
0 votes
2 answers
506 views

How to append text in the beginning of each line using sed

<AppendNhere> A H W C <AppendNhere> A H W C <AppendNhere> A H W C Sed '/^/ i N' filename I tried appending N using this, but it's appending N to the beginning of new ...
user avatar
  • 1
1 vote
0 answers
26 views

Getting hidden characters after extracting [duplicate]

I'm trying to extract value after Colon in a string which will be integer value later to compare, but I see $ and \r after extracting, so I'm not able to compare integers Ex: count=$(echo "...
user avatar
  • 11
1 vote
1 answer
1k views

How do i use the grep command in a different directory with out using cd

I want to search for a pattern in some files but without using cd to enter the directory they are saved in. How can i do that?
user avatar
0 votes
0 answers
306 views

open and save links in firefox from txt file

I have a txt file with several links (one per line) and I need to open each of these links (one at a time) in firefox, save the file and go to the next link (next line of the txt file). how can I do ...
user avatar
  • 75
7 votes
1 answer
10k views

Why doesn't auto complete work in my shell?

I am not so into Linux and I have the following doubts: a client provided me an Ubuntu 18.04.3 LTS virtual machine which I access via SSH. (I am using MobaxTerm as SSH client but it should not be the ...
user avatar
  • 3,939
0 votes
1 answer
127 views

Combine JPG and MP3 to MP4 using FileManager-Actions and shell script (Ubuntu 18.04)

What I try to achieve: Expanding my Nautilus context menu by an action to simply select a JPG-file and a MP3-file to combine them to a MP4-file like I already do in terminal by this command: ffmpeg -r ...
user avatar
  • 11
2 votes
1 answer
106 views

How to list also two lines after a grep match?

grep 'STRING' filename searches the file for STRING and lists the lines that contain a match. How can I also list two lines that follow the match?
user avatar
  • 1,725
2 votes
1 answer
582 views

sudo with dash gives bad substitution

I tried to access a newly installed system via Emacs' Tramp the way I do it with all my other system: C-x C-f /ssh:server|sudo:root@server:/etc/network/interfaces This command timed out. After some ...
user avatar
  • 261
0 votes
0 answers
21 views

I want all my service to run through my new user

This can be a long because i am very new to this linux so please help me with this, i created a new user using sudo adduser newUser sudo now i want all my services should run through this newUser, ...
user avatar
1 vote
1 answer
2k views

Diagnose 'sh: 1: Bad substitution' from /bin/sh -exc

I've been trying to compile some ocaml packages and keep running into some errors of the form sh: 1: Bad substitution (exit code 2), eg. /bin/sh -exc echo | m4 /bin/sh: 1: Bad substitution But, /...
user avatar
  • 205
0 votes
1 answer
961 views

Where is dash being used as default shell?

According to https://wiki.ubuntu.com/DashAsBinSh: The default login shell remains bash. Opening a terminal from the menu or shortcut [crtl-alt-t] provides interactive bash. A script run from ...
user avatar
  • 258
1 vote
1 answer
56 views

Untarring a file with limited hierarchy

I have created a tar file in terminal. Let's say I am currently in a directory test7. I am creating a tar in my current directory of a file which is inside another directory (test8). tar -czvf ...
user avatar
3 votes
1 answer
471 views

Ubuntu shell scripting [duplicate]

What is the difference between different shells in Ubuntu: $ cat /etc/shells /bin/sh /bin/dash /bin/bash /bin/rbash
user avatar
7 votes
1 answer
770 views

How to concatenate two command in shell

I used to have this command to count how many times I have click with a mouse, the command is xev | grep "ButtonPress". my colleague modify the command so that it return: ButtonPress 0 ButtonPress 1 ...
user avatar
1 vote
0 answers
380 views

Why 'xargs bash -c' is far slower than 'xargs sh -c'? [duplicate]

time seq 100 | xargs -i bash -c 'echo {}' ; 2.530s time seq 100 | xargs -i sh -c 'echo {}' ; 0.223s why? PS: The title of mine for this post is more intuitive to be discovered or searched by ...
user avatar
  • 141
3 votes
2 answers
2k views

How do I use command-line arguments to `sh` in the `-c` command string?

I know that sh -c 'echo $1' sh 4 will output 4. and sh -c 'echo $2' sh 4 5 will output 5. But I cannot understand how the parameters after the second sh were passed to the command next to sh -c. ...
user avatar
4 votes
1 answer
3k 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 --...
user avatar
1 vote
1 answer
256 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 ...
user avatar
6 votes
1 answer
17k 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?
user avatar
  • 1,134
7 votes
1 answer
2k 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 ...
user avatar
  • 2,224
1 vote
1 answer
273 views

Dash, command substitution not inserting newline?

Basically, this is the issue: $ echo Hello"$(printf '\n')"World HelloWorld What did I overlook ?
user avatar
10 votes
2 answers
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/...
user avatar
  • 3,490
4 votes
1 answer
459 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 ...
user avatar
1 vote
0 answers
452 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 ...
user avatar
  • 539
1 vote
1 answer
1k 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, ...
user avatar
0 votes
1 answer
433 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 ...
user avatar
3 votes
1 answer
511 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, ...
user avatar
10 votes
3 answers
2k 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 ...
user avatar
63 votes
4 answers
36k 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 ...
user avatar
  • 2,198
1 vote
1 answer
423 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 ...
user avatar
0 votes
2 answers
2k 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 ...
user avatar
0 votes
2 answers
1k 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 ...
user avatar
6 votes
1 answer
3k 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 ...
user avatar
1 vote
1 answer
66 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 (/...
user avatar
0 votes
2 answers
763 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 ...
user avatar
  • 107
-2 votes
1 answer
61 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 "******...
user avatar
0 votes
1 answer
112 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 ...
user avatar
0 votes
3 answers
2k 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 ...
user avatar
1 vote
2 answers
7k 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....
user avatar
8 votes
2 answers
1k 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 ...
user avatar
0 votes
1 answer
283 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 ...
user avatar
  • 167
3 votes
1 answer
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-...
user avatar
1 vote
0 answers
290 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 ...
user avatar
0 votes
1 answer
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....
user avatar
  • 185