3
votes
1answer
48 views

Using sed with parallel gives empty output when redirecting to file

I'm using the zsh shell. I am trying to use sed to substitute some text in many files, using parallel to speed up the process. When I tested this on one file and let the command output go to stdout I ...
1
vote
1answer
13 views

Odd issue with OR operator in zsh

I'm seeing an odd issue with CentOS 6.4, zsh 4.3.10 (x86_64-redhat-linux-gnu). This is running two regular expressions on the same string. Neither expression passes the if conditional, but when I OR ...
0
votes
1answer
44 views

Adding a jar file to CLASSPATH is still not executable

Perhaps I just don't understand how the whole CLASSPATH environment variable works when trying to find .jar files on your system. I thought if you specified it, you could launch .jar files with java ...
2
votes
1answer
31 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 ...
2
votes
3answers
224 views

How do you set alias sudo='nocorrect sudo ' correctly?

Until Recently I had alias sudo='sudo ' in my .zshrc file. Today I ran into this error on trying to do sudo mv: ➜ ~ sudo mv nginx.conf.orig nginx.conf.orig2 sudo: nocorrect: command not found Now ...
0
votes
0answers
22 views

ZSH and Passwordless access with SSH in a shared home environment

I have a small cluster with some nodes which share their home folder through NFS. I allow passwordless SSH access to the users with this script: if [[ -e $homeDirs/$username/.ssh/id_rsa.pub ]]; then ...
2
votes
2answers
75 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 ...
2
votes
2answers
42 views

Locating the source of a function in zsh

I have this annoying issue in my zsh shell where a function is being declared somewhere and that function is named "cp" so it's overriding the normal cp behavior. I'm trying to locate the function ...
1
vote
1answer
114 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
0answers
112 views

Terminator and Zsh: ctrl+D not closing session

I've been a Terminator and zsh user for a while with consistent profiles across several machines. However, on a freshly installed Linux Mint machine, for some reason Ctrl+D (EOT) isn't closing the ...
0
votes
0answers
32 views

After Reinstall of Rails, Cannot Run `rails server`

On my main dev computer, I had had ruby installed from a ppa. I decided to reinstall it with rvm for consistency between computers. To uninstall my current environment, I ran sudo apt-get remove ...
1
vote
1answer
48 views

Pre-compiled command line input in zsh

I recently set up a ubuntu 12.04 64 bit machine. I use tmux with many open windows, all of them use zsh as shell, some of them through a chroot environment that uses the same home folder of the normal ...
2
votes
1answer
120 views

make a certain software version the default in ubuntu

I currently have 2 version of php installed on ubuntu 12.04. one for php 5.3 installed using apt-get while the other one is installed with xampp with php 5.5 When i execute these commands: > ...
1
vote
2answers
57 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 ...
1
vote
1answer
180 views

Run a local command after closing an SSH connection?

I've set up my zsh to update the XTerm title whenever I change directories. It's neat! Unfortunately I have one common problem, which is this: % cd foo; # title changes to "host1:~/foo" % ssh ...
1
vote
1answer
135 views

Zsh crashes on specific tab completion (workon)

This is an annoying bug related to ZSH and python virtualenvwrapper. I couldn't find any clue on this anywhere on the web, so I am going to make a new post in SU! Symptoms Use ZSH, and python ...
4
votes
1answer
218 views

Zsh says “no matches found” when trying to download video with youtube-dl

I downloaded youtube-dl using pip on CrunchBang (a Debian Wheezy distro). When I run youtube-dl {video URL} I get zsh: no matches found: {video URL} I guess it has something to do with zsh, ...
3
votes
1answer
87 views

Setting the $SHELL environment variable

For some reason, when I run chsh -s /bin/zsh, my $SHELL environment variable isn't getting set. When I run: echo $SHELL It outputs: /bin/bash
2
votes
2answers
118 views

Is it possible to highlight the non-breakable space in zsh / terminal?

I’m looking for possibility to somehow highlight the non-breakable space (\xA0) in the shell output to distinguish it from the normal space during debug sessions. E. g., I would like to see the output ...
2
votes
1answer
258 views

Does zsh support hash table as a built-in data type?

If supported, which version of zsh should I use to take advantage of this feature? How to declare and use it in code?
1
vote
3answers
655 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 ...
0
votes
3answers
1k views

How to change Terminator title terminal title, ZSH on Debian?

I don't know if I should ask it here or on unix.stackexchange.com, I found this question here. My question is similar, I want to change the title of a terminal, I'm using a Debian based distro, ...
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
1answer
111 views

zsh running a comand but not from the path

My zsh is doing something odd, it is running an executable that is not the first executable on my path. I have a wrapper script for ssh but the wrapper is not being invoked while the real ssh binary ...
3
votes
2answers
380 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
3answers
273 views

How to make zsh completion like bash

I am using zsh. It is a nice shell, especially for the auto completion function. But, when I press tab, it always auto fill with the first completion option. For example, there are two files in my ...
3
votes
1answer
147 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 ...
1
vote
1answer
279 views

zsh fail to expand apt-get regex?

zsh seems to fail expand apt-get regular expression. For instance I would like to install all packages that has the prefix llvm-3.1, and I use: sudo apt-get install llvm-3.1* But zsh tells me that: ...
0
votes
2answers
112 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
211 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
244 views

Remove path until slash when typing in terminal

For instance, when I type a path in terminal cd project/example/one I can press Ctrl+W and remove the entire "word" project/example/one. Sometimes it's not very useful. Are there any shortcuts for ...
1
vote
2answers
264 views

tar backup zsh script

Trying to set up a cronjob ran tar script to backup site (without .git and setup folder) every night and upload time stamped archive to Dropbox. It gives me a hard time as archive is created along ...
2
votes
1answer
44 views

ZSH: Is it possible to get file completion to display results in a case-sensitive order?

Here's an example of what I mean: In my home dir, I have three directories starting with "work": $ ls | grep ork WorkProjects workspace workspacepython Notice that "WorkProjects" starts with a ...
4
votes
3answers
117 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" ...
3
votes
2answers
222 views

How to move files down a directory?

I have inherited a folder structure on a project and would like to simplify it a bit. I have a root full of folders (1st level) and each of those folders has a number of folders in it (2nd level) and ...
1
vote
2answers
400 views

How can I add a beep to ZSH's prompt?

I want to be notified when a job is done or something finishes in a terminal, and I read somewhere about adding a Bell to the command prompt, and then turning on urgentOnBell. But I can't figure out ...
4
votes
2answers
822 views

Detect long-running commands and notify when they complete

This is a long shot -- I don't think it's possible, but I figured I'd ask. I frequently run commands that take a few minutes to complete, and while they run I check my email or browse the Internet. ...
0
votes
1answer
706 views

VIM zsh, bash and colors in command line on Ubuntu

I have problem with VIM command line when calling system commands. e.g. !ls, all command output colors aren't parsed by VIM. My system is Ubuntu 12.04 LTS with VIM 7.3.429 from Ubuntu repositories. ...
0
votes
1answer
105 views

How does the .profile file work if I fork a process?

Lets say I open vlc or gimp on startup, but those commands don't return until the program closes. Does it just let a bash interpreter run indefinitely until they close or does it run and immediately ...
2
votes
2answers
308 views

What happens under the hood when I run a command line program in another programming language?

Some programming languages have system() exec() calls where I can run commands. What exactly happens when I do that? If I run system("ls") Does it run a bash interpreter on the string? Does it make an ...
2
votes
1answer
590 views

Why does grep return no results (list all files in directory)

I'm trying to count all files in a directory that match a pattern, recursively, using ls: ls -R | grep *.{cpp,h} | wc However, I get: zsh: no matches found: *.cpp ls -R does return results, ...
1
vote
1answer
586 views

Use user-installed shell? [duplicate]

How do I change my shell to one installed in my home directory? I installed a new zsh in my home directory, which is picked up: >> which zsh >> /home/myname/bin/zsh It's not listed in ...
2
votes
1answer
547 views

How to get ZSH previous command's history number in prompt?

I'm wanting to add the previous command's history number to my prompt, as well as the exit code. At present, %h[%?] Gives me the current history number, as well as the last exit code. What I'd ...
9
votes
3answers
4k views

How can I do Ctrl-Z and bg in one keypress to make process continue in background?

So I realized I follow this pattern of suspending the task and then letting it to continue too often with the Ctrl-Z bg sequence, I was wondering is there any way to compress that to single keypress? ...
8
votes
8answers
617 views

Per-directory bash/zsh history log files

I find I do a lot of work on a project in a set directory. Sometimes — a few months down the track — I need to redo something on that project but I can't remember what I did. I use ...
6
votes
1answer
2k views

#!/usr/bin/env Interpreter Arguments — portable scripts with arguments for the interpreter

Because interpreters such as zsh, bash, python, perl may be located in different places on the filesystem, scripts often have a shebang that uses env for portability, e.g. #!/usr/bin/env zsh. ...
2
votes
2answers
1k views

How I handle bindkey in zsh?

There is not a lot of info on that command, I didn't find a manpage nor a info and not more than examples on the web. Is there any tutorial or info on internet?
3
votes
1answer
599 views

How should I automatically change my .zshrc for different OS'?

I am currently storing most of my dotfiles in a git repository to make keeping them in sync across all my computers easier. I've just recently acquired a Macbook so now have to have all my dotfiles ...
4
votes
2answers
1k views

How can I make zsh completion behave like Bash completion?

I switched to zsh, but I dislike the completion. If I have 20 files, each with a shared prefix, on pressing tab, zsh will fully complete the first file, then continue going through the list with each ...
5
votes
3answers
16k views

How to delete files on the command line with regular expressions?

Lets say I have 20 files named FOOXX, where XX is the number of the file, eg 01, 02 etc. At the moment, if I want to delete all files lower than the number 10, this is easy and I just use a wildcard, ...