zsh

What are the differences in echo between zsh and bash?

余生长醉 提交于 2021-01-28 10:50:46
问题 In bash, in this specific case, echo behaves like so: $ bash -c 'echo "a\nb"' a\nb but in zsh the same thing turns out very differently...: $ zsh -c 'echo "a\nb"' a b and fwiw in fish, because I was curious: $ fish -c 'echo "a\nb"' a\nb I did realize that I can run: $ zsh -c 'echo -E "a\nb"' a\nb But now I am worried that I'm about to stumble into more gotchas on such a basic operation. (Thus my investigation into fish: if I'm going to have to make changes at such a low level for zsh, why not

In Bash, what is the meaning of every piece of “${BASH_SOURCE:-${(%):-%x}}”

醉酒当歌 提交于 2021-01-28 05:06:52
问题 Recently I wanted to know the best way to get the path to the currently running script/file in Bash. I found a lot of answers. In particular one was: "${BASH_SOURCE:-${(%):-%x}}" I remember deciding at the time that this was the best solution for my needs. Now I'm trying to remember why. I know what some of the pieces mean, but not all. And even with what I do know I can't put it all together to make any sense of it. It works. But why? Every effort I've made to find this specific code

Pyenv not picking up other python installations

∥☆過路亽.° 提交于 2021-01-27 11:27:09
问题 I am using pyenv to manage python installations and virtual environments. I have several python installations on my Mac (Catalina). The system python (python 2.7 in usr/bin) python 3.9 in usr/bin (coming from default installer from python.org/downloads) python 3.9 in /opt/anaconda3/bin/python3 (coming from https://www.anaconda.com/products/individual) For a project, I would need python 3.6. I know that conda offers the possibility to create virtual environments with a specific python version,

Pyenv not picking up other python installations

我怕爱的太早我们不能终老 提交于 2021-01-27 11:26:09
问题 I am using pyenv to manage python installations and virtual environments. I have several python installations on my Mac (Catalina). The system python (python 2.7 in usr/bin) python 3.9 in usr/bin (coming from default installer from python.org/downloads) python 3.9 in /opt/anaconda3/bin/python3 (coming from https://www.anaconda.com/products/individual) For a project, I would need python 3.6. I know that conda offers the possibility to create virtual environments with a specific python version,

Pyenv not picking up other python installations

岁酱吖の 提交于 2021-01-27 11:25:35
问题 I am using pyenv to manage python installations and virtual environments. I have several python installations on my Mac (Catalina). The system python (python 2.7 in usr/bin) python 3.9 in usr/bin (coming from default installer from python.org/downloads) python 3.9 in /opt/anaconda3/bin/python3 (coming from https://www.anaconda.com/products/individual) For a project, I would need python 3.6. I know that conda offers the possibility to create virtual environments with a specific python version,

Need help printing list

只愿长相守 提交于 2021-01-27 06:24:57
问题 I'm working on a todo list in Python and I am currently stuck on printing the todo list. I have my add code and view code as such: if sel == '1': #add task name = input("enter task name: ") prio = input("enter priority level (High | Medium | Low): ") add(todo, name, prio) view(task) elif sel == '3': #print todo list view2(task) exit and these are the functions im using: def add(todo, x, y): todo[x] = y def view(x): x.append(dict(todo)) def view2(x): print(x) I'm able to add items to a

zsh compinit: insecure directories error message on Mac, after installing Homebrew

随声附和 提交于 2021-01-27 04:42:18
问题 After installing Homebrew and Homebrew-Cask on my Mac (as administrator with user-id 'admin', running MacOS 10.12.6), I get the error message zsh compinit: insecure directories, run compaudit for list. Ignore insecure directories and continue [y] or abort compinit [n]? every time I start zsh. Investing the issue with compaudit, I found mentioned several insecure directories, most related to Homebrew - for example /usr/local/share/zsh/site-functions . This directory and its entries have access

Linux操作系统基础

こ雲淡風輕ζ 提交于 2021-01-23 06:07:40
如果你是第一次接触Linux的话先认识下面这些理论概念。 Linux简介 Linux是一种自由和开放源码的网络操作系统,存在着许多不同的发行版,比如有CtenOS、RedHat、Ubantu、Debian、SuSe、Gentoo、slackware等,但它们都使用了Linux内核,这个内核是由C语言写的。Linux可安装在各种计算机硬件设备中,比如安卓的手机是Linux的一种。 计算机体系结构 运算器 控制器 存储器 输出设备 输入设备 内核功能 进程管理 内存管理 文件系统 网络功能 硬件驱动 安全机制 Linux思想哲学 由目的单一的小程序组成,组合小程序完成复杂任务 一切皆文件 尽量避免捕获用户接口 配置文件保存为纯文本格式 交互式接口SHELL 在我们的系统应用程序中有一个很重要的程序,那就是我们的shell,它是帮助我们人机交互的,就像中国人说的是汉语,美国人说的是英语,如果这两个的人需要交流,那么我们中间得找个翻译官来进行翻译,那shell就相当这个翻译官。shell分为两种,一种是GUI,一种是CLI。 1.GUI接口 这个接口是比较常见的,在windows打开就能见到这个图形用户界面。在Linux有这三种图形用户界面,分别是Gnome、KDE、XFace。Gnome是用C语言写的,KDE是由C++写的。 2.CLI接口 CLI是命令行界面,也分为好许多类,有sh

Macos Catalina error after update: unable to run colorls

China☆狼群 提交于 2021-01-21 03:53:45
问题 Updating to macOS Catalina gives error on opening terminal ERROR: Can't find Ruby library file or shared library colorls usage: dirname path /Users/varunsukheja/.zshrc:source:91: no such file or directory: /tab_complete.sh When I checked for the .zshrc file for line 91, I found below line source $(dirname $(gem which colorls))/tab_complete.sh And on checking gem which colorls I got below error ERROR: Can't find Ruby library file or shared library colorls But when I check which colorls I get

Macos Catalina error after update: unable to run colorls

*爱你&永不变心* 提交于 2021-01-21 03:53:08
问题 Updating to macOS Catalina gives error on opening terminal ERROR: Can't find Ruby library file or shared library colorls usage: dirname path /Users/varunsukheja/.zshrc:source:91: no such file or directory: /tab_complete.sh When I checked for the .zshrc file for line 91, I found below line source $(dirname $(gem which colorls))/tab_complete.sh And on checking gem which colorls I got below error ERROR: Can't find Ruby library file or shared library colorls But when I check which colorls I get