Score:0

Terminal : bash: emulate: command not found

ng flag

I'm trying to fix the issue that executables downloaded by snap are not being added to the apps list or desktop. So I tried typing in

emulate sh -c 'source /etc/profile'

Though, it gave me this error:

bash: emulate: command not found

btw I have zsh installed

So what can I do ?

Knud Larsen avatar
by flag
I guess you have to switch to zsh : `$ zsh` ..... and then `$ emulate ....`
Salem avatar
ng flag
@KnudLarsen Thanks !! it worked !
Score:0
us flag

Installing "zsh" does not mean this is your default shell.

You are getting this error probably because you are running bash. What is the output of the $SHELL environment variable? Use the echo buitin command.

$ echo $SHELL
/bin/bash

Additional update from comments below (credits due):

The environmental variable $SHELL is set upon login and stays the same even a shell change within your session. There is another command you can invoke to determine your current shell.

readlink /proc/$$/exe

While next command gives you the installed shells on your system.

$ cat /etc/shells

/bin/sh
/bin/bash
/bin/zsh
/usr/bin/zsh
/usr/bin/git-shell

If you like to set your default shell to zch you'll have to find out where it's at:

$ type -a zsh   or which zsh

Then you can set your shell accordingly.

$ chsh -s /bin/zsh
cn flag
Note that `$SHELL` does not contain the shell you're currently running (the variable does not change if you launch zsh or any other shell) -- it contains your login shell.
bac0n avatar
cn flag
`readlink /proc/$$/exe` will probably be a better choice
mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.