2
votes
2answers
63 views

Converting an if-else statement into a switch statement [closed]

I'm having trouble turning this program from an if-else statement into a switch statement. Any help would be appreciated. #!/bin/bash for x in $@ do array[$i]=$x i=$((i+1)) done # initial state ...
3
votes
1answer
137 views

bash command line editing (Emacs shortcuts)

When writing a command on the bash command line, I can use CTRL+w to delete a word backwards, or ALT+d to delete word forwards. The problem is, that these two shortcuts are not exactly complementary: ...
3
votes
2answers
63 views

How to find Emacs backup files?

Emacs backup files start with .# but I can find those in my directory. I've try: find . -name '^\.#.*' or find . -name '.*#.*' and they are not show up, and I have them. For instance if I create ...
3
votes
1answer
125 views

Navigating the CLI: Go back N words

I'm a Vim user, so I'm learning Emacs commands for use in the Bash CLI. I know that on my systems I can use Vim-keybindings in Bash but I'd like to learn how to use it effectively in its default ...
4
votes
2answers
144 views

Emacs shell mode makes $PS1 different

I have a custom $PS1 variable that looks like this on my command line: And on emacs using M-x shell unfortunately looks like this: Here is my $PS1 variable export PS1='\[\e]0;\u@\h: ...
1
vote
1answer
82 views

Where is the Ctrl+/ (^/) bash shortcut for undo defined?

I can not find the mapping in bind -p nor in stty -a. Also, it only works in the terminal emulators I've tried (xterm, konsole, gnome-terminal) and not in the linux system console. I think it's ...
7
votes
3answers
783 views

My `which` command may be wrong (sometimes)?

I've compiled the last emacs version from the source code (v24.2) because the version installed on my machine is (quite) old for me (v21.3). I've done the usual: $configure --prefix=$HOME make make ...
1
vote
2answers
2k views

How to make a program which run from shell still live after close terminal? [duplicate]

Possible Duplicate: How do I prevent a script from terminating when the shell exits? I use gnome-terminal, and I run emacs under the terminal in the background by executing emacs &, but ...
5
votes
1answer
279 views

Emacs commands in xterm

I found that the commands I used to use in gnome-terminal, those I learned in Emacs, are only partially working in xterm. In some cases, I get strange chars like ÿ, æ, and â instead. Do you know how ...
0
votes
1answer
240 views

Is there more, less, or equal overhead for elisp, as for a bash script, to call awk, ps, etc?

Hopefully the question explains itself well enough. I'm referring to exta time and system resources involved for one vs. the other... I tend to think it would be the same, but I want to go beyond just ...
2
votes
1answer
1k views

Load my .profile for bash in Emacs terminal buffer? (multi-term mode)

I've got multi-term mode (derived from ansi-term) with bash started in Emacs 23.3, which is a terminal emulator running in Emacs. However, I noticed that it did not load my user profile, including ...
8
votes
6answers
409 views

How to disable emacs here document completion

When editing a bash script file with emacs, and trying to enter <<<, at the second < emacs insert a template for a here document, like in the following example: <<EOF EOF This is ...
5
votes
2answers
1k views

Open emacs in a terminal when editing crontab

I have setup emacs as my default editor in /etc/profile. When I want to use emacs in a terminal. I open it with the -nw option. How can I have the same behavior when doing a crontab -e preventing it ...