Notes, Effective Go

Last Modified: 2017-08-23 11:46:10

Hard to say, I finished Go, for about 20 days (except busy for 1 week and training for 1 week).

Such a long time, 1 week to learn a new language, having known a little about concurrency.

Not so bad.

Acknowledge

Go is a new language. Although it borrows ideas from existing languages, it has unusual properties that make effective Go programs different in character from programs written in its relatives.
The notes below was written from the view of a CPP programmer.

  • and a hello world
    1
    2
    3
    4
    5
    6
    7
    package main
    import "fmt"
    func main() {
    fmt.Println("Hello, World")
    }

阅读全文

Notes, Shell Script

Last Modified: 2017-08-11 11:18:00

Acknowledge

  • What is shell script?
    A shell script is a file containing a series of commands.

The first shell script

hello_world.sh

1
2
3
4
5
6
#!/bin/bash
# The line above is called a shebang.
# Every shell script should include this as its first line.
# This is our first script.
echo 'Hello World!'

  • make it executable
    1
    2
    3
    4
    5
    6
    7
    8
    ls -l hello_world
    -rw-r--r-- 1 me me 63 2009-03-07 10:10 hello_world
    chmod 755 hello_world
    ls -l hello_world
    -rwxr-xr-x 1 me me 63 2009-03-07 10:10 hello_world
    ./hello_word
    Hello World!

阅读全文

Notes, Shell

Last Modified: 2017-07-31 11:18:00

Acknowledge

  • What is shell?
    • The shell is a program that takes keyboard commands and passes them to the operating system to carry out.
    • Almost all Linux distributions supply a shell program from the GNU Project called bash.
    • Bash is an enhanced replacement for sh, the original Unix shell program written by Steve Bourne.
  • What is terminal emulator?
    • We use a terminal emulator to interact with the shell when using a GUI.
    • KDE uses konsole and GNOME uses gnome-terminal, though it’s likely called simply “terminal” on our menu.
  • Shell prompt

    1
    [me@linuxbox ~]$
  • Some Simple Commands

    • date - Display the current time and date.
    • cal - Display a calendar of the current month.
    • df - Display the current amount of free space on your disk drives.
    • free - Display the amount of free memory.
    • exit - End the terminal session.

阅读全文