zsh

macOS Catalina 10.15(beta) - Why is `.~bash_profile` not sourced by my shell?

喜夏-厌秋 提交于 2019-12-09 07:59:15
问题 I want to set the environment variable I added below the line to ~/.bash_profile and ~/.profile but it didn't work. export JBOSS_HOME=/Users/{USERNAME}/Desktop/jboss7 Afterward, exit the terminal and open it again when executing echo $JBOSS_HOME I get nothing. 回答1: Apple has changed the default shell to zsh. Therefore you have to rename your configuration files. .bashrc is now .zshrc and .bash_profile is now .zprofile . 回答2: I created a new file called /usr/local/bin/mybash which contains a

oh my zsh showing weird character '?' on terminal

会有一股神秘感。 提交于 2019-12-09 07:56:45
问题 I have installed iTerm2 and Oh-my-zsh. However there is a weird question mark that is coming ever since I have changed ZSH-THEME to "agnoster". Attaching the screenshot for the same. I thought powerline would help but that doesn't seem to happen. Can can anyone help me with this? 回答1: Installing a powerline patched font will solve this. This official documentation provides description about installing poweline fonts. There are two ways to enable powerline patched font in iTerm2. Set a

export function from zsh to bash for use in gnu parallel

自古美人都是妖i 提交于 2019-12-08 17:17:13
问题 How do I export a function from zsh, so that I can use it in gnu parallel? example: function my_func(){ echo $1;} export -f my_func parallel "my_func {}" ::: 1 2 in bash will output 1 2 whereas in zsh it will output error messages /bin/bash: my_func: command not found /bin/bash: my_func: command not found 回答1: zsh does not have a concept of exporting functions. export -f somefunc will print the function definition, it will not export a function. Instead, you can rely on the fact that bash

Why can't I get the cobalt2 zsh theme to work on my iTerm2?

谁说胖子不能爱 提交于 2019-12-08 04:50:39
问题 I want to install this ZSH theme . I downloaded both the iTerm2 and ZSH themes. The iTerm theme was imported through the preferences. The ZSH theme was inserted into ~/.oh-my-zsh/themes along with all the other ZSH themes. When I open my .zshrc and change ZSH_THEME="bobbyrussell" to ZSH_THEME="cobalt2" nothing happens. I restart iTerm but the colors are not changed. Updated with Details: ~ echo $ZSH_THEME cobalt2 ~ echo $PROMPT %/ ~ File: ~/.zshrc # Path to your oh-my-zsh installation. export

How much history will be saved in iTerm2 Shell Integration's Toolbelt?

本秂侑毒 提交于 2019-12-08 04:37:30
问题 Background : I installed shell integration in iTerm2 and enabled saving all command history to disk so it persists between sessions (Preferences > General > Save copy/paste and command history to disk). Questions : A) Is there is a limit to how much history will be stored? Does it follow the value assigned to the HISTFILESIZE environment variable, or is it controlled some other way, or limited by default? B) The history in the toolbelt contains additional information like the working

Perl command inside GNU parallel?

﹥>﹥吖頭↗ 提交于 2019-12-08 02:15:40
问题 I am trying to run this in parallel: parallel perl -pe '!/^step/ && s/(\S+)/sprintf("%.2e", $1)/ge' {} > {}.fix ::: * That is, I want to execute the perl command on all files in the current directory, in parallel. This is not working, but I have no idea why. Comment: The perl command is fixing floating-point numbers in tables. See Replacing precision of floating point numbers in existing file. 回答1: In Bash you can make a function: doit() { perl -pe '!/^step/ && s/(\S+)/sprintf("%.2e", $1)/ge'

MAC配置终端(item2 + oh-my-zsh + solarized配色方案)

孤街醉人 提交于 2019-12-07 18:48:21
https://www.jianshu.com/p/246b844f4449 安装item2: 下载地址 将iTem2设置为默认终端: (菜单栏)iTerm2 -> Make iTerm2 Default Term 然后打开偏好设置preference,选中Keys,勾选Hotkey下的Show/hide iTerm2 with a system-wide hotkey,将热键设置为command+. ,这样你就可以通过command+. 全局热键来打开或关闭iTerm2窗口,非常方便。 配色方案: http://ethanschoonover.com/solarized 下载后解压到某个位置 然后打开 iTerm2 下的偏好设置 preference ,点开 profiles 下的colors 选项,点击右下角的 Color Presets 选项,选择import ,导入解压到的 solarized 文件下的Solarized Dark.itermcolors 。 安装oh-my-zsh github连接: https://github.com/robbyrussell/oh-my-zsh 使用 crul 安装 sh -c "$(curl -fsSL https://raw.github.com/robbyrussell/oh-my-zsh/master/tools

Iterm2安装Zsh + Oh My Zsh+Solarized

心已入冬 提交于 2019-12-07 18:48:10
安装Oh My Zsh curl -L https://raw.github.com/robbyrussell/oh-my-zsh/master/tools/install.sh | sh 安装Zsh: 1.安装zsh brew install zsh 2.配置iterm2 sudo vim /etc/shells 输入: /usr/local/bin/zsh chsh -s /usr/local/bin/zsh 3.然后重新启动iTerm2,zsh就已经被配置成默认的shell了。 安装Solarized: 1.下载: git clone git://github.com/altercation/solarized.git 2.安装 然后打开 solarized/iterm2-colors-solarized/ 双击里面的文件 3.配置iterm2 依次打开 iTerm2 - Preferences - Profiles - Text - Text Rendering,将 Draw bold text in bright colors 前面的勾去掉 来源: oschina 链接: https://my.oschina.net/u/2391658/blog/1859379

Recursively search directory of binary files for hexadecimal sequence?

故事扮演 提交于 2019-12-07 16:31:17
问题 The current commands I'm using to search some hex values (say 0A 8b 02 ) involve: find . -type f -not -name "*.png" -exec xxd -p {} \; | grep "0a8b02" || xargs -0 -P 4 Is it possible to improve this given the following goals: search files recursively display the offset and filename exclude certain files with certain extensions (above example will not search .png files) speed: search needs to handle 200,000 files (around 50KB to 1MB) in a directly totaling ~2GB. I'm not too confident if the

read all shell variables in ruby

谁说我不能喝 提交于 2019-12-07 15:37:41
问题 Problem: I'm running shell script as subprocess in ruby script, after running script I want to have an option to check all environment variables of the shell, including array variables. So far I have come up with: set | awk -F= 'BEGIN {v=0;} /^[a-zA-Z_][a-zA-Z0-9_]*=/ {v=1;} v==1 && $2~/^['\''\$]/ {v=2;} v==1 && $2~/^\(/ {v=3;} v==2 && /'\''$/ && !/'\'\''$/ {v=1;} v==3 && /\)$/ {v=1;} v {print;} v==1 {v=0;} ' Which quite good shows only variables, including arrays, multiline strings and