1
vote
1answer
21 views

Alternative to “fc -s” in zsh?

In bash, I had a handy alias: alias r="fc -s" Which just repeated last command. Same as !!. I am now used to it (muscle memory), but I can't seem to figure out how to recreate the alias. fc doesn't ...
0
votes
1answer
26 views

Tried Installing ZSH through cygwin and then trying to use zsh through Cmder

I tried to install Cygwin (64 bit version) on my computer, and it went through hunky-dory until at the very end, autorebase.bat failed with exit code 1. I read through the logs and they weren't too ...
0
votes
1answer
46 views

Do I have to manually update my PATH in Cygwin shells?

I use Cygwin on Windows 7. I'm not really a Windows user, so it's already a little inconvenient for me to have to have this extra layer in between my OS and Zsh, my shell of choice. Now, I frequently ...
2
votes
2answers
102 views

sed error when launching terminal on OS X

I get these error messages when launching bash or zsh in standard Terminal.app or iTerm2 sed: 1: "\#^system_type=# { s#^s ...": extra characters at the end of p command sed: 1: "\#^system_type=# { ...
1
vote
2answers
27 views

How to exclude a file from a command with ZSH?

Given this directory content : one.file two.file three.file in bash, when I enter rm *.file !(two) only one.file and three.file are deleted. How can I do this in ZSH?
2
votes
2answers
60 views

How do I handle multiple quotes in an alias (for bash or zsh)

I am using zsh, and I am trying to use python as a simple calculator. I'm very familiar with python, but can't seem to get the alias (or function) to work properly. So far I've got: pycalc() { ...
0
votes
0answers
40 views

Why is there a bash process running in my Terminal if I use Zsh?

When I run the "top" command on OSX Mavericks, a bash process appears even though I am using Zsh, why?
2
votes
1answer
38 views

Dynamic directory hash

There's a nice method in zsh called hash -d with example usage: hash -d magic=/very/long/name/$USER/even/more Then I can cd ~magic/deeper. Is it possible to achieve the same result but so that ...
1
vote
1answer
78 views

Zsh autocomplete function with sed

I'm struggling to write an ZSH autocomplete function. My goal is to autocomplete ta's and tk's first argument with the projects listed in tmux list-sessions and tmuxinator list. Here's what I have so ...
2
votes
1answer
231 views

What's the ZSH equivalent of BASH's $PROMPT_COMMAND?

BASH supports a $PROMPT_COMMAND environment variable that defines a command to be executed before any first-level interactive prompt. I'm looking for a ZSH equilvalent of that. The documentation says ...
2
votes
1answer
384 views

Redirect stdout/stderr of a background job from console to a log file?

I just run a job (assume foo.sh). ./foo.sh [Press Ctrl-Z to stop] bg # enter background And it generate output to stdout and stderr. Is there any method to redirect to stdout and stderr to other ...
0
votes
2answers
36 views

the same tr translate failed on some of machine

I use the following code and failed. $ echo $TERM xtermc $ v=/bin:/usr/bin:/usr/local/bin ; echo $v | tr ':' '\n' /binn/usr/binn/usr/local/bin It seems skip my '/'. I don't know how to solve this. ...
0
votes
2answers
48 views

Zsh: how to auto complete after a command?

everyone. It's a little difficult to explain what I want to do. I want to create a script 'example', which can input long commands for you after you run it with short parameters. For example, $ ...
2
votes
2answers
82 views

env -i zsh | How is this magic possible?

I'm currently working, for school, on a home-made shell, therefore I'm kind of curious nowadays about how shell vars are set. Yes, this can be really exciting ! Anyway, we obviously have to deal with ...
1
vote
1answer
131 views

Why does my zsh prompt wander upwards when window is too narrow?

I have a weird behaviour that seems to be a combination of zsh and maybe urxvt (?) My setup is this: I start urxvt -e 'tmux' to get myself a terminal which launches zsh as the default shell. I then ...
0
votes
1answer
153 views

ConEmu (with bash/zsh etc. shell) - can't use key bindings using “Meta” (Alt) key

I have key bindings created with zsh such as: bindkey -s "^[l" 'ls -lrt --color=always\n' that I want to execute in ConEmu by holding "Alt" and pressling "l". It just prints a rectangle character ...
0
votes
1answer
58 views

zsh function cannot be used in tmux

I wrote up a special function to wrap a command, in ZSH, so it doesn't output any warnings and runs the process in my background. This command works great without tmux, but when I try to use it in a ...
3
votes
1answer
47 views

bash's command number ( \# ) equivalent in zsh

I'm looking for a character to put in my zsh's $PROMPT that would be equivalent to bash's \# (the command number of this command, according to this site). So far I've found only %h but this is not ...
1
vote
0answers
87 views

Unintended autocomplete or alias in Terminal

There is a "strange" autocomplete function in my macbook. If I try to type "ps -aux" in terminal (iTerm or TotalTerminal) with the hit of "s" in ps, automatically this happens: "ps -p $$ # Tells the ...
1
vote
1answer
433 views

Mac OSX Mavericks - ZSH can't 'source ~/.zshrc', too many open files

I can't source any changes to my .zshrc (or my .bash_profile for that matter), because I get this error when I try: /Users/ME/.zshrc:source:100: too many open files: /Users/ME/.zshrc I've tried ...
0
votes
2answers
30 views

How to run “time” on a function in zsh

This works: time ls -l This does not work f() { ls -l } time f No time output is printed in the second case. Why?
1
vote
1answer
127 views

Disabling “oh-my-zsh” SVN completion

I am using Zsh version: 4.3.11 with the oh-my-zsh framework. When coupled with "oh-my-zsh", Zsh will attempt to autocomplete SVN (and Git for that matter) commands when the TAB key is pressed during ...
2
votes
1answer
94 views

Common keyboard shortcuts for zsh zle and bash readline

I use zsh as my shell, but there are a lot of commandline programs which use readline. I also like to configure different keyboard shortcuts (e.g. ctrl backspace and ctrl delete). Is there a way to ...
0
votes
1answer
50 views

How to zsh pipe to grep to match remote branches beginning with 'orgin/'

I tried this: git branch -r --merged | grep '^origin/' But I get nothing... When I remove the caret: ✗ git branch -r --merged | grep 'origin/' origin/HEAD -> origin/master ...
0
votes
1answer
175 views

How to batch rename files using bash

I know there are lots of such questions, but I couldn't find one (or a combination of several), which describes the things I want to do. I think I need to use regular expressions, but I am not very ...
1
vote
2answers
60 views

Alias for directory using a symbol

I'm looking to set up an alias for my work directory, which can change as I change context, and I was trying to find something that was short enough to stand in as a replacement for ~. I'd be tickled ...
2
votes
1answer
80 views

What's the rule on using the word “git” as an alias?

I used to keep my git aliases in a file outside of my .gitconfig file, in the normal format of: alias gb="git branch --verbose" which worked great. But, after looking around at others' dotfiles, I ...
1
vote
1answer
292 views

Split window programmatically with iTerm?

on my development workstation I often have to start the same commands every morning. zeus start, zeus server (booting rails via zeus), redis-server, and like 3 others. I know a lot of people would ...
1
vote
3answers
733 views

After switching back to bash can't access root

I'm new to Linux and using Debian 7. I was using bash, but tried out zsh by using chsh. Initially probably entered a bad shell name but eventually switched to zsh successfully. Now I switched back to ...
1
vote
1answer
595 views

Terminal starting with “no such file or directory:” message on OS X

After installing/uninstalling homebrew and other command line software such as zsh, I had an issue with my command line prompt, which let me to remove several configuration files such as .bashrc, ...
0
votes
3answers
79 views

Temporarily transferring shell settings to remote ssh session?

I am curious, frequently I would like to transfer all of my shell settings (dotfiles) over to a remote session just during my session and then have them reversed when I logout. Even better would be ...
1
vote
3answers
100 views

How to create a series of commands in shell, which will stop execution on error

My usual git workflow for deploying is the following: [while on master branch] git pull git push git checkout production git pull git merge master git push Would it be possible to create a ...
3
votes
1answer
183 views

How to benchmark bashrc / zshrc and prompt rendering time?

As im currently experimenting with new stuff in my prompt i need a way to tell what the performance impact is. How can i monitor how long it takes to render my prompt and the time it takes to source ...
1
vote
2answers
209 views

How to merge ls commands colors with the output of find or du?

I have a simple alias to list the size of files&folders in cwd. ( including dotfiles in this case , ignoring zero sizes ) du -sh .[!.]* * | sort -hr | grep -v '^0' which can be achieved ...
3
votes
2answers
392 views

How to execute a function in bash or zsh on every letter being typed into prompt?

I know about preexec() hooks for zsh and the way this can be achieved in bash. ( link ) But can i get the current input while still typing? The idea behind this question is the following: in order ...
2
votes
1answer
150 views

What is the bash equivalent of zsh vared command?

I saw that with zsh vared you can edit on the fly the specified environment variable. Is there an equivalent command for bash? Thanks
3
votes
1answer
158 views

Edit Current Command in Zsh Vi Mode

So I know that you can set vi mode in bash with set -o vi I also know that you can set vi mode in zsh with bindkey -v The vi mode in bash has a great feature that allows you to edit the command ...
4
votes
1answer
297 views

How can I get zsh to display international characters properly?

I just started using zsh, and love it. However, I've stumbled upon an annoyance when it comes to international characters: ➜ ~ touch åäö.txt ➜ ~ ls ...
2
votes
2answers
113 views

How to look at the past directory history the shell was in?

Sometimes I like to look back in the command history to figure out what I was doing. Sometimes it would help to know what the cwd was for each command. So, I'm wondering if there's some way to track ...
0
votes
2answers
125 views

How to deal with the shell input before it executed in Bash or zsh? [closed]

everyone. I am a bash/zsh user(Linux). I want to realize the following things. First, input the command in the bash/zsh shell, like: $ wonderful: In fact, a program named `wonderful:' doesn't ...
0
votes
3answers
245 views

Break out of nested functions in a shell

If I have a series of nested functions, how can I break out of all of them from the innermost function? EDIT: Busy looking into the builtin 'trap'...
1
vote
1answer
55 views

How to source zshrc from bash script

I have a script written in bash that sets up my zsh config and changes current user's shell to zsh if needed/possible. After default shell is changed, I want zsh to load my new profile, but when I do ...
1
vote
1answer
127 views

put in bash or zsh history absolute path to files I working on

I have found that in bash i frequently use something like that: vim ./somefile1 less less ./dir1/dir2/somefile2 cp some_other_relative_path_to_file and so on After that when I trying to find a ...
1
vote
1answer
298 views

How can I get bash-like job control in zsh?

I want to configure zsh so that its job control behaves more like (I think) bash does by default. In particular: When I start a background job, it is by default owned by the shell and can be ...
0
votes
1answer
122 views

Zsh alternative to bash's quick assignment and inheritance trick

There's a trick available in bash allowing you to set environment variable for child process and run it in single line, retaining original values of variable in the shell. For example, in order to set ...
3
votes
2answers
122 views

Do aliases slow down a shell's start?

Sometimes my shell (zsh) takes longer to start than usual (I open the terminal, and it hangs a bit until I can input commands). I have a few aliases on my .zshrc (well, actually they're in a ...
4
votes
3answers
119 views

Transparent usage of temporary files as means of piping

As many of us are surely aware, it's always a good idea to make your program accept stdin input. Very many programs do allow that *nix environments. This lets us do cool things like piping echo "foo" ...
0
votes
1answer
456 views

How do I set the Android bash path in ZSH?

Looking through the Cordova Android docs, I see this line You need to add the path to your Android SDK platform-tools and tools directory. In my example I will use ...
1
vote
2answers
403 views

Converting bash to zsh: declare function and if statement

I have copied this code from somewhere and am trying to modify it for my needs. It was designed for bash but I am running it under zsh. I always have trouble running bash scripts under zsh, as there ...
0
votes
1answer
268 views

Sourcing bash_prompt (bash script) when running zsh (oh-my-zsh)

I have a theme that is written in bash (I think). However, I have decided to use zsh for my shell. More specifically, I'm using oh-my-zsh (a customised zsh I believe). The theme I want to use is ...