effective-shell

授权协议 Readme
开发语言 SHELL
所属分类 应用工具、 终端/远程登录
软件类型 开源软件
地区 不详
投 递 者 孟思远
操作系统 跨平台
开源组织
适用人群 未知
 软件概览

effective-shell

Release Please Creative Commons BY-NC-SA

Text, samples and references for my 'Effective Shell' series. This website is hosted at effective-shell.com.

If you find this book useful, please do consider sponsoring me to help support my open-source work!

<iframe src=" https://github.com/sponsors/dwmkerr/button" title="Sponsor dwmkerr" height="35" width="116" style="border: 0;"></iframe>

Introduction

This repository contains all of the content for the Effective Shell online book.

Installing the Samples

You can install the samples into your ~/effective-shell folder with this command:

curl effective.sh | sh

Or can also manually download them using from any of these locations:

The one-line shell installer is hosted at github.com/dwmkerr/effective-shell-installer

The Website

The content in this repository is built into a static site available at effective-shell.com. This is done using Hugo.

This section contains information on how to built, use and edit the site. To help you quickly edit the site, some tips are below:

Building the Website

This website is built with Hugo. It is very easy to setup and run locally.

To setup dependencies, run:

make setup

To serve the site locally, run:

make serve

To build the site, run:

make build

The built site is generated at ./website/public.

Note that the samples folder is automatically zipped up and added to the website, meaning it can be downloaded directly from:

https://effective-shell.com/downloads/effective-shell-samples.zip
https://effective-shell.com/downloads/effective-shell-samples.tar.gz

Updating the Theme

The site uses the github.com/dwmkerr/hugo-book theme, which is a fork of alex-shpak.

Versioning

The version of the site and the code is defined in the version.txt file. This makes it reasonably straightforward to script actions which require the version.

Releasing in managed via Release Please in the release-please.yaml workflow file.

Copyright & Licensing

All content is Copyright (©) Dave Kerr. Please get in touch by opening an issue if you have questions on copyright or licensing.

Creative Commons BY-NC-SA

This work is licensed under a Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License.

Thanks!

Thanks to the following people who have helped with reviews, comments, suggestions.

  • 2. 构造/析构/赋值运算 条款05: 了解C++默默编写并调用了哪些函数 默认会为每个类创建以下的几个函数,但是特别情况下,像拷贝赋值操作符重载不一定会构建,例如给const的类成员赋值时就会拒绝使用重载符=。 // 默认生成的构造函数 class test { public: test(){} 构造函数 test(const test& rhs){} 拷贝构造函数

  • 资源管理 在程序编写过程中需要面对大量资源的管理问题,包括内存、文件描述符、互斥锁、图形界面中的字型和笔刷、数据库连接、网络sockets。 经过训练后,基于对象的资源管理办法,几乎可以消除资源管理问题。 条款13: 以对象管理资源 为防止资源泄露,请使用 RAII 对象,他们在构造函数中获得资源并在析构函数中释放资源。 std::shared_ptr 和 std::auto_ptr 是常用的 R

  • 让自己习惯c++ 条款01: 视c++ 为一个语言联邦 如今的 c++ 已经是一个 多重泛型编程语言,一个同时支持过程形式、面向对象形式、函数形式、泛型形式、元编程形式 的语言。将 c++ 看作一个联邦,主要包括四个部分: C: c++ 是 c 的继承,但是包含很多 c 语言以外的特性 Object-Oriented c++: 这部分就是 c with class Template C++: 这是

  • 构造/析构/赋值运算 条款05: 了解 c++ 默默编写并调用哪些函数 编译器可以暗自为 class 创建 default 构造函数、copy 构造函数、copy assignment 操作符 以及 析构函数。 即使你写了一个空类,编译器仍然会为它声明一些方法: class Empty {}; // 等价于 class Empty { public: Empty() {} Empt

  • 条款四 对于no -local static 对象尽量将每个no-local static对象,搬到自己的专属函数里面,这些函数反对一个reference 指向他们所含的对象(这些static对象),然后用户调用这些对象 /*no local static expect local local static: ​ in class ​ int function ​

  • shell中的内建命令, 函数和外部命令 Shell识别三种基本命令:内建命令、Shell函数以及外部命令: (1)内建命令就是由Shell本身所执行的命令。    有些命令是由于其必要性才内建的,例如cd用来改变目录,read会将来自用户(和文件)的输入数据传给Shell外亮。    另一种内建命令的存在则是为了效率,其中最典型的就是test命令,编写脚本时经常会用到它。另外还有I/O命令,例如

  • if  条件 then  Command else  Command fi                              别忘了这个结尾 If语句忘了结尾fi test.sh: line 14: syntax error: unexpected end of fi     if 的三种条件表达式 if command then if  函数 then  命令执行成功,等于返回0 (比如

  • C++为一个语言联邦 1.概念:C++是一个面向对象的程序程序设计,那么对于面向对象,他是C语言的衍生版,所以它既可以进行C语言的过程化设计,又可以进行以抽象数据类型为特点的基于对象的程序设计,还可以进行面向对象的程序设计。 2.对于C++而言,它之所以被称之为语言联邦,是因为它有四个次语言, 如下: C语言:由于C++语言是C语言的衍生出来的,以C语言为基础,所以具有C语言的一些行为,如:区块,

  • 第 2 章 函数(下) 第 18 条:用数量可变的位置参数减少视觉杂讯 令函数接受可选的位置参数(由于这种参数习惯上写为 *args,所以又称为 star args,星号参数),能够使代码更加清晰,并能减少视觉杂讯(visual noise)。 例如,要定义 log 函数。以便把某些调试信息打印出来。加入该函数的参数个数固定不变,那它就必须接受一段信息及一份有待打印值的列表。 def log(me

 相关资料
  • Effective C++ 视 C++ 为一个语言联邦(C、Object-Oriented C++、Template C++、STL) 宁可以编译器替换预处理器(尽量以 const、enum、inline 替换 #define) 尽可能使用 const 确定对象被使用前已先被初始化(构造时赋值(copy 构造函数)比 default 构造后赋值(copy assignment)效率高) 了解 C+

  • Effective Scala Guide 是 Twitter 公司的一份 Scala 编程语言指南! 中文文档:http://twitter.github.io/effectivescala/index-cn.html Scala是Twitter的主要应用编程语言之一,大部分基础架构是使用Scala编写,有几个大型库包在支持应用,Scala是一种大型高效语言,在实践中要谨慎使用。它的陷阱在哪里,

  • 对每个人来说,习惯C++需要一些时间,对于已经熟悉C的程序员来说,这个过程尤其令人苦恼。因为C是C++的子集,所有的C的技术都可以继续使用,但很多用起来又不太合适。

  • C++标准模板库(STL)是革命性的,但是要想学会并用好却并不容易。 Scott Meyers(EffectiveC++与More effectivec++的作者)揭示了专家总结的一些关键规则,既有专家们总是采用的做法,也有专家们总是避免的做法。 通过这些规则,STL程序员可以最大限度地使用STL。在讲述50条指导原则时,本书提供了透彻的分析和深刻的实例,以让读者学到要做什么,什么时候该这样做,以

  • Go 是一门全新的语言。尽管它从既有的语言中借鉴了许多理念,但其与众不同的特性, 使得使用 Go 编程在本质上就不同于其它语言。将现有的 C++ 或 Java 程序直译为 Go 程序并不能令人满意——毕竟 Java 程序是用 Java 编写的,而不是 Go。

  • Scala是Twitter使用的主要应用编程语言之一。很多我们的基础架构都是用scala写的,我们也有一些大的库支持我们使用。