Tag Info

Hot answers tagged

5

oh-my-zsh enable two things, which cause this behavior: AUTO_CD: If command can not execute, and command is a directory name, perform cd to that directory CDABLE_VARS: If the argument to a cd command (or an implied cd with the AUTO_CD option set) is not a directory, and does not begin with a slash, try to expand the expression as if it were preceded by a ~ ...


5

This should do the trick: awk -F '[<>]' ' NR!=1 && FNR==1{printf "\n"} FNR==1{sub(".*/", "", FILENAME); sub(".xml$", "", FILENAME); printf FILENAME} /double/{printf " %s", $3} END{printf "\n"} ' $path_to_xml/*.xml > final_table.csv Explanation: awk: use the program awk, I tested it with GNU awk 4.0.1 -F ...


4

Regarding glob expansion possibly exceeding a limit - yes and no. The shell's already running, and so it won't stop. But if you were to pass the entire globbed array as arguments to a single command, then yes, that is a definite possibility. The portable and robust way to handle this involves find... find . \! -name . -prune -name pattern -type f -exec cat ...


4

If you don't want rsh and rsyslog to be ever completed in any situation just add the following into .zshrc: zstyle ':completion:*' ignored-patterns 'rsh|rsyslog'


4

Set your Warning options as an array. "${warnings[@]}" generates 3 individual words warnings=(-Wall -Wextra -Wpedantic) "${compiler}" "${warnings[@]}" "${standard}" -o "${1}" "${1}.cpp" Or, if you find it more legible, you can create the array without -W's, and then add -W's via how you present the array on the command line. warnings=( all extra ...


3

zsh do not read .zshrc in non-interactive shell, but zsh allow you to invoke an interactive shell to run a script: $ zsh -ic 'type f' f is a shell function or you can always source .zshrc manually: $ zsh -c '. ~/.zshrc; type f' f is a shell function


3

zstyle handles the obvious style control for the completion system, but it seems to cover more than just that. E.g., the vcs_info module relies on it for display of git status in your prompt. You can start by looking at the few explanatory paragraphs in man zshmodules in the zstyle section. You can simply invoke it to see what settings are in effect. This ...


2

In zsh, print is a built-in command. (And, in bash, printf is a built-in command.) The command, /usr/bin/print, is used to run mailcap programs. The -z switch is defined this way from the zsh manual: Push the arguments onto the editing buffer stack, separated by spaces; no escape sequences are recognized.


2

Yes, you do see the recommendation for -U often, usually paired with -z. It’s not documented in the run-help for autoload, but there is a section titled “AUTOLOADING FUNCTIONS” in the manpage for zshmisc. There it states: The usual alias expansion during reading will be suppressed if the autoload builtin or its equivalent is given the option -U. ...


2

Try executing this inside your tmux session: tmux display-message -p '#S'


2

Works fine here with zsh v. 5.0.8 Brace expansion with single characters was added in Jan 20141 so if you're using a version prior to 5.0.6 then it's not available. 1: see also the discussion here


1

You have two copies of screen. One of them stores its sessions in /tmp/uscreens and the other stores its sessions in /var/run/screen, so they don't see each other's sessions. Even if you could force them to see each other's sessions there's a chance that the copies of screen are different versions and bad things would happen if the two talked to one ...


1

A "plugin" in OMZ is just a script. You can't disable part of it without modifying the script. A workaround would be to use Antigen or Zgen, copy the script to some other location, modify it accordingly, and load it as a separate bundle. Both Antigen and Zgen are designed to support OMZ so you won't have to change anything substantive in your setup.


1

Aside from using a control code to manually restart, you might consider using a system which is specifically designed to automate this kind of procedure, that is, (re)starting a process after code changes, such as watchman. You could also use inotifywait (from inotify-tools) to notify when a file representing source code changes, and send a signal when it ...


1

If you do not want to use loops your choices are limited as it essentially precludes just automatically restarting you program again and again. Still you can at least cut out the step with ↑ by using the accept-and-hold widget. This runs the current command line (just like accept-line which is usually bound to Enter) but also pushes it onto the buffer ...


1

You need to set default-command: set -g default-command /usr/local/bin/zsh default-shell variable only use to create a login shell, when default-command is empty - which is default value. Or you can simply change your default shell to zsh, in this case, tmux will start a login shell, instead of non-login shell.


1

I know I'm a little late to the party, but to undo exported environment variables, you can use the env command env -i zsh env runs the command given as an argument, and -i gives it a clean environment. Hope that helps someone!



Only top voted, non community-wiki answers of a minimum length are eligible