0
votes
1answer
27 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 ...
2
votes
2answers
38 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 ...
5
votes
5answers
207 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
80 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
2answers
99 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 ...
16
votes
4answers
767 views

Path independent shebangs

I have a script that I want to be able to run in two machines. These two machines get copies of the script from the same git repository. The script needs to run with the right interpreter (e.g. zsh). ...
3
votes
1answer
147 views

How to disable “auto cd” in zsh with oh-my-zsh

Googling this didn't show up any results. Here's what I mean: I have a binary file named x in my path (not the current folder, but it is in the PATH), and also a folder with the same name in the ...
5
votes
5answers
110 views

`ls -l` of a file and all the directories leading to it?

Before I start writing a (probably easy) script, is there a command that does the equivalent of the following one: [:~/software/scripts] % ls -ld / /usr /usr/bin /usr/bin/tee drwxr-xr-x 21 root root ...
1
vote
1answer
63 views

Is there an advantage in using ksh over zsh? [closed]

Or are there any advantages for using ksh over zsh? Would any specific commands not execute successfully across the shells or are the major differences not command related, but something else?
3
votes
2answers
1k views

How to change default shell to ZSH - chsh says “invalid shell”

I installed ZSH on a VM of mine, where I compiled it from source. The location of ZSH is /usr/local/bin/zsh when I run chsh -s /usr/local/bin/zsh it outputs chsh: /usr/local/bin/zsh is an invalid ...
0
votes
1answer
44 views

Getting tree command to not display directories

I've read through the man pages for tree but I don't know if it is possible to have tree list only the filenames for all files that appear in any recursive search of a directory. The closest I have ...
4
votes
1answer
68 views

How can I configure ZSH's vi mode to persist the state between commands?

I am aware how to set ZSH's default line editor to use vi-like keybindings... bindkeys -v ...and even to default each new prompt to be in command mode instead of insert mod by default... ...
2
votes
1answer
99 views

How can I use “emulate sh” in zsh to work with “. myscript.sh”?

I've been using emulate sh -c ". $HOME/myscript.sh" and it's working so far. However, if I'm at ~ and try to do emulate sh -c ". myscript.sh", I get .: no such file or directory: myscript.sh.. Why?
0
votes
2answers
78 views

zsh: What does the command “time + number” do in zsh

When I type time + number in zsh: # atupal at local in /tmp/atupal/setup/bin [10:01:49] $ time 1 /tmp/atupal/setup/bin/lib/python2.7 # atupal at local in /tmp/atupal/setup/bin/lib/python2.7 ...
2
votes
1answer
149 views

Command not found in zsh [duplicate]

In bash, whenever I try to run a command which is not installed, I get a message which tells that the package is not installed and how to install it. This functionality is provided by installing the ...
6
votes
4answers
234 views

Prevent terminal from displaying previously executed command

I have a script that allows me to log random thoughts while working on a project. In the terminal I would add a new log entry by running $ @ "some random thought" where @ is just an alias for my ...
3
votes
2answers
129 views

Is there a hook-like system for shell?

I noticed I like to execute certain actions in a specific order. A hook, as I see it, is basically "do something after event", where event, could be any command with parameters, such as git clone, ...
1
vote
2answers
64 views

Capturing the name of the file pointed by a symbolic link in a variable

Say I have a symbolic link: /path/to/foo->/path/to/some_file.txt Say I have a shell variable x=/path/to/foo, how can I get some_file.txt in a shell variable y?
1
vote
1answer
56 views

Making an alias which maps arguments to the middle of the command

I want to alias killapp X to pidof X | xargs kill or kill `pidof X`, but I can't think of a way to do this with just an alias on killapp. How could I do this so I don't have to do killapp X` ?
5
votes
3answers
290 views

How to cd automatically after git clone?

I want to automatically cd to the directory created by the clone command after I git cloned something. Shell: ZSH if that matters.
3
votes
2answers
202 views

List all dotfiles current directory using zsh

How can I list all dotfiles in a directory using zsh.?
4
votes
1answer
58 views

Zsh completion that is insensitive between `_` and `-`

I don't like typing underscores, and would like to type a dash instead, and have zsh autocompletion treat it like it could be either a dash or an underscore. Is this possible with built-in zsh ...
10
votes
4answers
609 views

Search for a previous command with the same prefix when I press Up at a shell prompt

Coming from a FreeBSD world I wish to make the Linux terminal behave like FreeBSD one, especially the 9.1 version, basically when you type cd in the terminal and push the "up" arrow you can browse all ...
3
votes
3answers
88 views

Is there something like closures for zsh?

I just decided to try zsh (through oh-my-zsh), and am now playing with precmd to emulate a two-line prompt that has right prompts in more than just the last line. So I clone the default theme, and ...
0
votes
1answer
48 views

Executing a script in .zshrc

I'm trying to use z (link) to make navigating a little easier. The problem is that I have the following in my .zshrc file, but it doesn't seem to work: export PATH=$PATH:/home/x/z alias ...
13
votes
2answers
669 views

How to background a command chain?

I want to background a command chain like cp a b && mv b c && rm a. I have tried doing cp a b && mv b c && rm a & but this only backgrounds the last process. How ...
2
votes
2answers
102 views

Absolute path to currently-running zsh?

Sometimes the output of ps -p $$ shows the absolute path to the currently-running zsh, % ps -p $$ PID TTY TIME CMD 1027 ttys005 0:00.11 /usr/local/bin/zsh but not always: % ps -p ...
5
votes
3answers
301 views

Getting relative links between two paths

Say I have two paths: <source_path> and <target_path>. I would like my shell (zsh) to automatically find out if there is a way to represent <target_path> from <source_path> as ...
3
votes
2answers
217 views

cd to directory of a symbolically linked file

Before I write a script, anyone know an easy way to do the following: $ pwd /foo/bar $ ls -l lrwxr-xr-x 1 username admin 48 Apr 17 2012 foo.sh -> /bar/foo.sh $ cd /bar $ ls foo.sh i.e., in ...
2
votes
4answers
107 views

$PATH duplication issues

If I do echo $PATH I get the following: ...
5
votes
2answers
141 views

Passing glob expressions to functions/scripts

The following script is supposed to concatenate multiple csv files in a path specified in the first argument into a single csv file specified in the second argument #!/bin/zsh set -x set -v ...
1
vote
1answer
307 views

Getting “zsh: command not found: time” when running `time` in subshell

I installed ZSH (and Oh-My-ZSH) on a Ubuntu 12.10 64 bit machine a few days ago. I just tried to do: time (time ls) and got this error: zsh: command not found: time ( time ls; ) 0.00s user 0.00s ...
0
votes
1answer
45 views

Weird behavior when sourcing .zshrc

I'm using zsh 5.0.2 (x86_64-apple-darwin12.3.0) on the latest MacOSX. If it makes any difference, I have also enabled oh-my-zsh. The shell seems to be missing the .zshrc file when I want to source ...
3
votes
1answer
80 views

Ignore files for zsh's completion for SVN

I managed to configure zsh such that it does not suggest LaTeX temporary files when I use autocompletion for emacs by adding this line to my ~/.zshrc: zstyle ':completion:*:*:emacs:*:*files' ...
2
votes
0answers
101 views

zsh: Echoing every statement?

I have an odd problem with zsh when I switch between shells in a particular way: Option 1 (works well): I start a zsh shell. I switch to tcsh with /bin/tcsh, and I switch back to zsh with /bin/zsh ...
-1
votes
1answer
566 views

zsh: Is it worth the switch from bash? Is it the time? [closed]

I have been a bash user for years now. However, I find that zsh is increasingly gaining momentum. I came up with the following questions: Is zsh really becoming that popular? Will it compete with ...
2
votes
2answers
339 views

Why is `kill -s INT <zsh PID>` behaving differently from `Ctrl-C`?

Starting with: % donothing () { echo $$; sleep 1000000 } % donothing 47139 If at this point I hit Ctrl-C at the same terminal that is controlling the shell, then the function donothing does indeed ...
2
votes
1answer
734 views

dircolors on zsh: Unrecognized keywords: MULTIHARDLINK, RESET & CAPABILITY

I am trying to get the solarized color theme to work in my terminal. I read the instructions here but I get the following dircolors error: dircolors: `/home/avazquez/.dircolors_zsh':90: unrecognized ...
2
votes
3answers
485 views

Treatment of backslashes across shells

How do echo and printf treat backslashes in zsh, bash and other shells? Under zsh I get the following behavior: $ echo "foo\bar\baz" foaaz $ echo "foo\\bar\\baz" foaaz $ echo 'foo\bar\baz' foaaz $ ...
12
votes
1answer
791 views

When is double-quoting necessary?

The old advice used to be to double-quote any expression involving a $VARIABLE, at least if one wanted it to be interpreted by the shell as one single item, otherwise, any spaces in the content of ...
5
votes
1answer
132 views

ZSH: What's the difference between `.` and `source`?

I used to think that the built-ins . and source are equivalent. This question agrees with me when it comes to bash. However I encountered the following using zsh: desktop➜ ~/pst . env ...
1
vote
2answers
161 views

Different shells for interactive and non-interactive work

Due to constraints at my workplace, the default shell for every user is tcsh, and I am required to use tcsh as my non-interactive shell (i.e. we do most of the environment configuration across ...
1
vote
0answers
30 views

Make zkbd ignore $DISPLAY

Is it possible to make zkbd ignore $DISPLAY variable? I have set up when I log in to different X sessions and it is annoying if suddenly I need to reenter/copy configuration (and I have no idea why ...
1
vote
2answers
613 views

OS X setting environment variables

I have OSX 10.8.2 with ZSH as my shell and iTerm as a terminal (don't know if the last thing is relevant). I have to mention that I'm relatively new to OSX. I'm trying to set up some environment ...
1
vote
1answer
76 views

How to make ZSH tab completion work with two tabs

I saw a question like this on here, but the answer didn't work for me. I'm trying to set up tab completion and I want it that if I have two files fileA and fileB and I type fil<tab> it first ...
0
votes
2answers
482 views

Comparison of shells? [closed]

Do shells have any actual advantages or disadvantages? They can all run any binary, they all support pipes and > (output to file). Why would one choose bash over sh, or sh over ksh, etc? Why does ...
4
votes
3answers
131 views

Can any shell do argument-level interactive search?

Sometimes I need to reuse certain long arguments like paths. If I use history search (CTRL+R), I may find some command that contains the path, but I still need to delete anything else in the old ...
0
votes
3answers
455 views

Proper place to put shell prompt(PS1) when use sh/bash/zsh together

I'm using dash(sh) or bash or zsh. If possible, I would prefer to put in common place. I want to put proper PS1 settings when I interactive with shell, so these situation should be considered login ...
4
votes
2answers
792 views

Bash function not working in Zsh

I have been slowly migrating from Bash to Zsh and have got to the point where everything I have moved across is working well, with one exception. I have a couple of functions in my .bashrc that I use ...
-1
votes
1answer
67 views

Config File Sequence for ZSH?

I know there is an elaborate sequence of config files that BASH reads sequentially (or alternatively skips if a particular one is present), however I have for the most part adopted ZSH as my default ...