Zsh is a shell with many advanced command-line and scripting features.

learn more… | top users | synonyms (1)

0
votes
0answers
11 views

Zsh - Modify “mv” Completion (w/ Quotes)

I've been using Zsh recently, and when I complete a file name within quotes, the completion adds a space after the completed file name. Interestingly, this does not occur when I complete directory ...
0
votes
0answers
30 views

Bash script for opening screens and compiling the same file

I have written a bash script to initiate separate screen sessions and run a command in each of them that compiles the same C++ source file in ROOT (an object-oriented data analysis framework ...
1
vote
1answer
25 views

How to make `less -FX' play nice with a 2-line shell prompt

My shell prompt is two lines long (a fancier version of [%n@%m %~]'$'\n''%#. I have $LESS set to -FX. When I quit less, it leaves a single line at the end of my screen, and since my prompt has two ...
1
vote
2answers
28 views

Livesearch with first 10 matches as preview for zsh-history?

I have seen a history-livesearch with a preview, that shows the 10 first matches in the history in a list below the BUFFER-line, which is updated on every keystroke, and acts like the standard ctrl+r ...
2
votes
0answers
49 views

How can you get the current terminal line (the one that is still editable by the user)?

I need a way to use the current line which the users typed into as variable for a shell function. my current code, which can be called by ctrl+r zle -N search bindkey "^R" search search () { read ...
2
votes
3answers
90 views

Display ZSH brace expansion

Is there a way to show the expanded version of a brace expansion statement? For example, I have: $ bundle exec rake db:{drop,create,migrate} Does the expanded version expand to this? $ bundle ...
3
votes
2answers
40 views

How can I check GMail messages with prompt for password from a script?

I'm using zsh on Ubuntu 14.04 over SSH using Putty and I'm setting up the key bindings for my keyboard. Because zsh doesn't seem to make use of my function keys I thought I'd setup scripts to do ...
0
votes
1answer
9 views

Cannot access elements of an array in zsh

I am trying to write a script in zsh and I need to make use of arrays in order to achieve my aim in an elegant way. After reading some information over the Net, I tried to implement and access the ...
2
votes
0answers
78 views

How to write a shell script to run multiple command in different screen sessions?

My goal is to write a zsh script in order to create multiple screen sessions and run separate commands on each of them. I would also like to check at the beginning of my script if there are any ...
4
votes
2answers
58 views

Display possible corrections but do not apply them automatically

I have the following completion: zstyle ':completion:*' completer _complete _approximate As a result if I type something incorrectly and hit TAB I will see a list with corrected propositions (what ...
7
votes
3answers
91 views

Resolve all aliases in a zsh command line

I have nested aliases and I want to resolve all of them before executing the command. How do I do that? If there is a function that is not bound to any keys then M-x foobar is fine for me too. I ...
1
vote
3answers
121 views

Joining files on disk

Say I have several file with the following naming: 000001 000002 000003 ... Each of these files is a csv file (may include escape characters). In total the folder has ~20GB of data. How can I ...
0
votes
3answers
48 views

Bad substitution error in zsh shell

Hi in my previous question I got clarity on how to use associative arrays in zsh shell. But whenever I trigger the following command in my script for KEY in ${!array[@]} to iterate amongst the keys ...
3
votes
2answers
50 views

Show older or newer history items with the history command in zsh

I typed in the history command and it showed me the last 10 commands executed by me. Now I wanted to see the last 20 commands executed by me so (after reading the documentation): An argument of n ...
3
votes
2answers
30 views

Disable glob qualifiers in zsh

Is there a way to disable glob qualifiers with zsh? It seems like a useful feature, but it gets in the way of normal parentheses. I use ag to search files, and ag mymethod(param) causes zsh to ...
0
votes
0answers
14 views

I have downloaded and un-tarred zsh, what do I do next [duplicate]

I am running Linux Fedora 20, and have downloaded and un-tarred tar -jvxf zshell/zsh-5.0.5.tar.bz2, and now have what looks like the correct directory, as in the following listing which also shows ...
2
votes
1answer
35 views

Persistent directory stacks across sessions in zsh

I would like to share my directory stack (the one accessed with dirs) across sessions and tmux panes/windows. In the zshbuiltins man page I have found autopushd to add every directory I switch into ...
0
votes
1answer
23 views

All directories wrongly identified as git repos in zsh

I am using zsh and Oh-My-Zsh on Ubuntu 14.04. For some reason all directories are indicated to be git repos. This is true for all oh-my-zsh themes, which leads me to believe that this is a zsh issue ...
7
votes
4answers
250 views

How can I suppress the space between generated arguments during brace expansion?

I used the following command to create a list of URLs that I want to test: echo -e ...
1
vote
1answer
32 views

reset for loop counter

Simple question: if I have a for loop (zsh) over an unreliable list, by which I mean the list contains entries that can't be predicted beforehand, then can I reset the for loop counter? This ...
0
votes
1answer
34 views

Must pass urls in quotes

I'm trying pass a URL to mpv for it to play it as a network stream. This can be done in bash with the following syntax: $ mpv http://myvideosite.com However, zsh wants to evaluate the URL as ...
16
votes
6answers
701 views

How to type several file names with fewer key strokes

If I want to convert a pdf to a png image with imagemagick I do something like: convert -trim -density 400 this_is_a_very_long_filename_of_my_pdf_file.pdf ...
2
votes
2answers
41 views

how to filteri by asterisk or similar expression by rsync in zsh

I have a lot of files named like: /var/log/foo/2014-07-06-01.log ... /var/log/foo/2014-07-20-04.log Everyday I have several log files and I want to download specified day's log files: $ rsync ...
4
votes
1answer
34 views

How can I get back into “normal” edit-mode after pressing esc in zsh (vi mode)?

I'm using zsh in vi-mode. When I go to normal mode with ESC and then back into insert mode (for example using i, a or s), the line editor kind of "protects" the part of the line in front of the char, ...
3
votes
2answers
37 views

Is there a way to bypass .zshrc on login?

I'm enjoying learning ZSH, but one thing's bugging me. If I put something in my .zshrc that renders the shell useless (I'm playing with something that affects the way the keyboard is interpreted), ...
2
votes
1answer
74 views

Issue with zsh segfaulting: how to further assess the issue?

I'm using Linux arch 3.15.2-1-ARCH x86_64. I don't use zsh (zsh-5.0.5-1) every day, otherwise I would have noticed it segfaults, when I launch it from the bash cli: arch kernel: zsh[2187]: segfault ...
3
votes
2answers
196 views

Thousands separator in printf in zsh

I have been trying to define a thousands separator in printf for a while now and I have discovered that zsh has some problems with it. In bash I can use something like: $ printf "%'d\n" 1234567890 ...
2
votes
2answers
50 views

zsh completion - show more options than just the alias

I am trying to modify the behaviour of zsh completion and its menus. I'm stuck, and I've read so much documentation it's making my head spin. The following is only an example; I'd prefer answers that ...
3
votes
1answer
314 views

zsh: set TERM=screen-256color in tmux, but xterm-256color without tmux

I need my $TERM to be xterm-256color outside of tmux (in "plain" terminal with zsh), but screen-256color inside tmux. First I tried: add export TERM='xterm-256color' to my ~/.zshrc. add set -g ...
3
votes
1answer
67 views

List directories with dot directories last, then dot files

I'm aware of the ls option --group-directories-first but that's not exactly what I want to achieve. The output should be: (sorted by name ASC) Directories Hidden Directories Hidden Files
2
votes
2answers
142 views

Killing subprocesses after the script has finished or is killed

Say I have a script like the following #!/usr/bin/env zsh ./subscript.sh & # do stuff ... # do more stuff I would like the process running subscript.sh (and any processes initiated by it) to be ...
3
votes
3answers
364 views

How do you “disable” oh-my-zsh (and zsh) without uninstalling it?

I was trying new dev environments including zsh and oh-my-zsh. Now that I have installed oh-my-zsh, it starts by default on my terminals (iTerm2 and terminal) always start with zsh and with the ...
5
votes
2answers
94 views

Command re-assigned

I found a Bash script snippet earlier with which to echo a string to stderr: echoerr() { echo "$@" 1>&2; } echoerr hello world This remained in my clipboard, and when I wanted to edit a file ...
5
votes
5answers
246 views

Serialize shell variable in bash or zsh

Is there any way to serialize a shell variable? Suppose I have a variable $VAR, and I want to be able to save it to a file or whatever, and then read it back later to get the same value back? Is ...
3
votes
3answers
103 views

Can't open shell after changing default shell

I changed my default shell to zsh from bash in Ubuntu. I used the steps explained in http://github.com/sorin-ionescu/prezto and ran chsh -s zsh. After this, I couldn't able to log in to any shell as ...
3
votes
0answers
43 views

How to combine zsh autocomplete for wrapper function arguments and existing command

I work mostly in gvim and many terminals. Originally, I preferred to open all my files in a single vim instance. To that end I used an alias to open files from my terminals in the current 'vim ...
7
votes
5answers
346 views

Making zsh default shell without root access

I am using my school's computers and would like to use zsh instead of bash. I'd like to make it default, but I cannot run a command such as $ chsh -s $(which zsh) because I don't have admin ...
0
votes
0answers
75 views

zsh/Prezto: difficulties with right prompt alignment

This may be stupidly simple, but... I am trying to make my own prompt for Prezto. I have been using numerous prompts for reference (I can post a list if necessary). My RPROMPT and cursor are refusing ...
2
votes
1answer
133 views

Double rm verification in zsh

When I do a rm * in zsh, I get something like this: 2014-06-08 10:14:23 $ rm * zsh: sure you want to delete all the files in /home/assay/assay/log [yn]? y rm: remove regular file `development.log'? y ...
1
vote
1answer
85 views

Send copy of a script's output to a file

Say I have a Zsh script and that I would like to let it print output to STDOUT, but also copy (dump) its output to a file in disk. Moreover, the script starts with the following option set -o xtrace ...
0
votes
1answer
111 views

Ruby Version Prompt (Oh My ZSH) not working outside of TMUX

I am working on some Ruby development, and I installed RVM on my Mac. I regularly use TMUX. I have Oh My ZSH configured to show the Ruby version in my prompt. When I am in TMUX it shows my ruby ...
3
votes
0answers
170 views

git completion with zsh: filenames with spaces aren't being escaped properly

Git completion: I'm having difficulty with git's filename autocompletions on my system. I'm using zsh (5.0.5) with git (1.9.3) on OS X (10.9.3). Both zsh and git have been installed via homebrew. ...
2
votes
0answers
56 views

Corrupt files after extracting with Cygwin's GNU tar

I have a bunch of tarball backups which I just restored onto my new Windows 8.1 + Cygwin system using GNU tar: zsh$ for file in **/*.tgz; do tar xvzf $file; done To my surprise a lot of these ...
3
votes
2answers
150 views

Start zsh with a custom zshrc

I want to be able to start zsh with a custom rc file similar to the command: bash --rc-file /path/to/file If this is not possible, then is it possible to start zsh, run source /path/to/file, then ...
3
votes
1answer
168 views

Why does this command to copy files in a for loop work in bash but not in zsh?

I'm trying to copy a bunch of files with the same name, but in different subdirectories, to a single directory, changing the names to ones based on the paths to the original files. I use a for loop ...
1
vote
1answer
38 views

Using a zsh function in find?

I'm on OS X and have defined a function called finderpackage that tries to determine if a folder is in fact a "package" (also, somewhat erroneously, known as a "bundle") according to the Finder. My ...
2
votes
1answer
45 views

Globbing fails in zsh, but works in bash

I have an alias in bash, that I'm trying to port over to zsh. I thought it may have been the alias itself, but now it seems it's just the globbing. grep -irl --exclude=\*.{log,class,fuegoclass,dat}* ...
2
votes
1answer
42 views

scp wildcard not working in zsh

I have switched over to zsh, and it is working fine. One strange thing, when I try to scp with a * wildcard, it does not work, and I have to drop into bash. The second command below works fine. Any ...
0
votes
0answers
32 views

zsh completion doesn't correct ? (question mark) in paths

So, I've been pretty happy with my zsh completion and correction configuration for a while now, with this being a major exception. Configured as I have it, the shell routinely catches and corrects ...
7
votes
2answers
414 views

alias vs export for simple commands

For simple commands like less, is it better to make an alias or to export the options? Is there any benefit of one over the other? For example, if I want less to always use the -R option to show raw ...