zsh

Combine multiple awk output to print on one line

生来就可爱ヽ(ⅴ<●) 提交于 2020-01-15 03:27:06
问题 I have two different functions I wrote, each with their own AWK to search for a specific file in multiple directories and output the information I need. Both functions print the FILENAME and a specific field I need and work just fine on their own. I want to combine them together for more robust output. I am not a programmer. I wrote these while reading about awk as I went. Function 1 cver () { X="" case $1 in ("-b") X="bb";; ("-c") X="cpe";; ("-e") X="etech";; ("-k") X="core";; ("-o") X=

Cucumber: pipe output without losing color

余生长醉 提交于 2020-01-14 10:08:34
问题 I'm using cucumber to run some tests. It colorizes its output using ANSI escapes. This is great, but currently its producing more output than I care about, and shoving things I do care about off the screen. There doesn't seem to be a way to eliminate the other lines from within cucumber, but I can pipe the output through grep to pare down to the ones I care about. The downside of this solution, though, is that all the colors are lost. I know it's not my shell or grep's fault, because % echo "

Manjaro安装配置指南

随声附和 提交于 2020-01-13 04:07:15
由于可能会有偶尔重装系统的需要,而每次配置都丢三落四,浪费时间,因此整理了自己需要的配置,一直会继续更新的 1.安装 分区时选择手动分区 挂载点 大小 /boot/efi 500M /boot 1G / 剩余所有 2.更新源 sudo pacman-mirrors -i -c China -m rank //更新镜像排名,选择最快的那一个(延迟小的那个) sudo pacman -Syy //刷新 sudo pacman -S vim //先安装vim,之后用的多 sudo vim /etc/pacman.conf 在这个文件的最后添加几行: [ archlinuxcn ] SigLevel = Optional TrustedOnly Server = https://mirrors.tuna.tsinghua.edu.cn/archlinuxcn/ $arch 其中的网址根据之前选择的源来选择最快的: ## CDN (ipv4, http, https) ## aliyun Server = http://mirrors.aliyun.com/archlinux/ $arch ##上海交通大学 Server = https://mirrors.sjtug.sjtu.edu.cn/archlinux-cn/ $arch ## 浙江大学 (浙江杭州) (ipv4, ipv6,

How can I prompt for yes/no style confirmation in a zsh script?

社会主义新天地 提交于 2020-01-12 05:41:07
问题 Using zsh, I'm trying to put a step in my ~/.zprofile where I interactively ask a yes/no style question. At first I tried this bash-style approach, but I saw errors of this form: read: -p: no coprocess (I'm aware that typically the zsh syntax is different from bash's - I tried preceding it with a sh emulation command - emulate -LR sh - but it made no difference). This page implied the syntax might be different, so guided by this page and the zsh man page, I tried this instead: read -q REPLY?

Opening a new terminal tab in OSX(Snow Leopard) with the opening terminal windows directory path

做~自己de王妃 提交于 2020-01-11 17:41:14
问题 I've been Googling for a while looking for a simple way to do this, and I can't find one. I have a custom terminal environment set up (zsh) with various aliases and functions to make things easier. One thing I keep running into is that I will quickly APPLE-t to create a new tab and then type a command relative to the path of the terminal window I was just in. This invariably fails because the path of the new tab is ~/ instead of whatever I was just using! Any ideas for a script to set the

Zshell starts up with exit status of 1 after uninstalling RVM

拈花ヽ惹草 提交于 2020-01-11 12:51:28
问题 I've just uninstalled rvm—I ran rvm implode and removed rvm from $PATH in my .zshrc , as specified in this Stack Overflow post. Since uninstalling, I've noticed that my shell startup has an exit status of 1 . I've checked this by using echo $? after loading the shell—I always get 1 back. I briefly reinstalled rvm to confirm that's what caused the change, and sure enough, after reinstalling, my exit status was back to zero on startup. I've tried commenting out my zshell so that there's no

Zshell starts up with exit status of 1 after uninstalling RVM

你。 提交于 2020-01-11 12:51:12
问题 I've just uninstalled rvm—I ran rvm implode and removed rvm from $PATH in my .zshrc , as specified in this Stack Overflow post. Since uninstalling, I've noticed that my shell startup has an exit status of 1 . I've checked this by using echo $? after loading the shell—I always get 1 back. I briefly reinstalled rvm to confirm that's what caused the change, and sure enough, after reinstalling, my exit status was back to zero on startup. I've tried commenting out my zshell so that there's no

更优雅地使用命令行

为君一笑 提交于 2020-01-08 23:55:29
工欲善其事,必先利其器,通过武装自己的命令行工具,从而更优雅地使用命令行,可以使工作更加高效并且有趣。本文将以下几个方面来介绍命令行的使用技巧和提效工具 CLI 一键呼入呼出 iterm2 是一款完全免费,为 MacOS 打造的终端工具,特色功能是可以开启热键窗口,达到一键呼入呼出的效果 效果如下: 详细设置如下: 1、首先,进行如下设置 preferences > Keys > HotKey > Create a Dedicated Hotkey Window... 2、接着,设置热键,并选择 Animate showing and hiding 和 Floating window 这两个选项 zsh 目前常用的 Linux 系统和 OS X 系统的默认 Shell 都是 bash。 oh my zsh 是强化版的 Shell 如果是 Mac OS,默认应该自带了 zsh 了,安装之前可以确认一下 cat /etc/shells # List of acceptable shells for chpass(1). # Ftpd will not allow users to connect who are not using # one of these shells. /bin/bash /bin/csh /bin/ksh /bin/sh /bin/tcsh /bin/zsh

如何更改登录的shell

十年热恋 提交于 2020-01-08 00:08:47
1 我想知道我机器安装了哪些shell? 两种方法可以查看: 第一种: [rocrocket@wupengchong ~]$ chsh -l /bin/sh /bin/bash /sbin/nologin /bin/zsh 第二种: [rocrocket@wupengchong ~]$ cat /etc/shells /bin/sh /bin/bash /sbin/nologin /bin/zsh 其实chsh -l也是来查看这个文件。 2 我想知道我当前正在使用的shell是哪个阿? [rocrocket@wupengchong ~]$ echo $SHELL /bin/bash 注意SHELL一定要是大写。可以看到,我目前使用的shell是/bin/bash 3 执行了zsh之后,我查看当前shell类型仍然是/bin/bash呢? 请注意,我们虽然执行了zsh,但是所谓“当前的shell”是一个大环境的概念,是针对一个已登录的用户而言的。而我们执行zsh只是启动了一个zsh的解释器程序而已,并没有改变大环境。如果想改变“当前的shell”,那么还是要使用chsh才可以。 4 我想把我的shell改成zsh! [rocrocket@wupengchong ~]$ chsh -s /bin/zsh Changing shell for rocrocket. Password:

Syntaxis error when Start Rails Server after first configuration

柔情痞子 提交于 2020-01-07 07:40:09
问题 I am trying to run rails server and I get the following error after the first configuration: => Booting WEBrick => Rails 4.2.6 application starting in development on http://localhost:3000 => Run `rails server -h` for more startup options => Ctrl-C to shutdown server Exiting (erb):32:in `<main>': undefined method `ENV' for main:Object (NoMethodError) from /Users/rodpoblete/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0/erb.rb:864:in `eval' from /Users/rodpoblete/.rvm/rubies/ruby-2.3.0/lib/ruby/2.3.0