Stack Exchange Network

Stack Exchange network consists of 174 Q&A communities including Stack Overflow, the largest, most trusted online community for developers to learn, share their knowledge, and build their careers.

Visit Stack Exchange

Questions tagged [zsh]

Zsh is a shell designed for interactive use, although it is also a powerful scripting language.

0
votes
0answers
19 views

Avoiding incompatibility between Brew and Conda using a wrapper

Homebrew and Conda are known to not play well with each other. I like using both Brew and Conda, so I need a simple way to get them to work on the same system without breaking anything. In order to ...
2
votes
1answer
25 views

Finding (and counting) duplicate JS/Java files

I have the following script which takes minutes to give output. ...
3
votes
0answers
74 views

Colorized zsh prompt with support for Virtualenv and Git

I took the agnoster theme and re-wrote it to this: ...
2
votes
0answers
69 views

Chip-8 Emulator in Zsh

I've spent the last few weeks writing a Chip-8 emulator in zsh. It doesn't run in bash but the syntax is nearly identical. I have it on a GitHub repo here: https://github.com/hcorion/chipzsh a ...
1
vote
1answer
81 views

Pathmunge function in zsh

pathmunge is an often-seen function in shell initialization files, used to add entries to the PATH environment variable without ...
5
votes
1answer
63 views

`ls` indicates when directory is empty/full of dotfiles

I want ls to print a message when run on an empty or full of dotfiles directory. Instead of: $ ls empty_dir/ dotfiles/ $ I ...
2
votes
1answer
49 views

Sort and source configuration files from one of two directories

In a zsh I want to loop over all files in a configuration files' directory (/etc/myapp/) to source them. The files should be sourced in order and are named with two ...
2
votes
1answer
70 views

Shell agnostic startup flow - env, profile, rc, login

The goal of these files is to have some common behavior between Bash and Zsh when starting them. As is known, when Bash starts as a login shell it will source the first found of the following in your ...
0
votes
1answer
143 views

Print a “shebang” line, or prepend it to a file

This is a sort-of-useless "utility" I wrote to learn my way around shell programming better. My concerns are: Is the code readable? Could it be more efficient, or just simpler? The logic ends up ...
10
votes
4answers
6k views

Unix shell function for adding directories to PATH

Adding a directory to the PATH in Unix/Linux is a very common task. However, what if the directory is already in the path? My goal is to write a shell function (...
4
votes
1answer
62 views

Two similar shell functions that run different programs

I have a script that contains two shell functions: ...
3
votes
1answer
84 views

zsh system status script

The following script is being used to generate the status line in wmii. I'm curious if there are faster/more efficient ways to find the various info I'm grabbing. I'm also a relative newbie when it ...
5
votes
1answer
123 views

A z-shell function to quickly cd into projects

I think many know the problem of working with multiple projects: private projects, company projects, probably even projects for multiple companies. From day-one, I've always searched for better ways ...