Commit 8e9bd52

bryfry <bryon.fryer@gmail.com>
2017-01-17 14:36:26
bash and script
1 parent 475b399
Changed files (2)
unix/commands/bash.md
@@ -32,6 +32,24 @@ It is highy reccomended to skim the entire bash man page.
 |---------------------|--------------------------|
 | `bash -c <COMMAND>` | run the provided command |
 
+### Shell & Environment variables
+
+Use `set | less` to list current bash shell variables.  
+Use `env | less` to list the current environment variables.  
+[Environment & Shell Variables](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps)
+
+### History
+
+Bash history behavior can be modified with the below shell variables.  
+Use `set <VAR>=<VALUE>` and `unset <VAR>` to modify shell variables.  
+Use `set | less` to list current bash shell variables.
+
+| Variable | Explanation                                                                                                            |
+|----------|------------------------------------------------------------------------------------------------------------------------|
+| HISTFILE | The name of the file in which command history is saved. <br />If unset, the command history is not saved when a shell exits. |
+| HISTSIZE | The number of commands to remember in the command history.                                                             |
+
+
 ## Reference Materials
 
  * [Bash Builtins](http://www.tldp.org/LDP/abs/html/internal.html)
@@ -42,3 +60,4 @@ It is highy reccomended to skim the entire bash man page.
 ## Additional Reading Materials
 
   * [Mastering Bash and Termial](https://www.blockloop.io/mastering-bash-and-terminal)
+  * [Environment & Shell Variables](https://www.digitalocean.com/community/tutorials/how-to-read-and-set-environmental-and-shell-variables-on-a-linux-vps)
unix/commands/script.md
@@ -0,0 +1,43 @@
+---
+date: "2016-12-01"
+draft: false
+title: "script"
+tag: ["cli", "commands"]
+category: "unix"
+
+
+---
+
+## Summary
+
+| OS      | Default Available | Online Man                                                                                                      |
+|---------|-------------------|-----------------------------------------------------------------------------------------------------------------|
+| Linux   | Y               | [script](http://man7.org/linux/man-pages/man1/script.1.html)                                                    |
+| Solaris | Y               | [script](https://docs.oracle.com/cd/E26502_01/html/E29030/script-1.html)                                        |
+| BSD     | Y               | [script](https://www.freebsd.org/cgi/man.cgi?script(1))                                                         |
+| MacOS   | Y               | [script](https://developer.apple.com/legacy/library/documentation/Darwin/Reference/ManPages/man1/script.1.html) |
+
+| Basics | Command |
+|--------|---------|
+| Version | `script --version` |
+| Usage info | `script -h` |
+| Man | `man script` |
+
+## Usage
+
+Record all shell data to a file, including prompts, inputs, commands, and output.
+
+## Examples
+| command | description |
+|---------|-------------|
+| `script <typescript>` | start script log |
+| `script -a <typescript>` | start script log and append it to the log file (don't overwrite)|
+| `exit` | stop recording |
+
+## Reference Materials
+
+  * 
+
+### See Also
+  * [ttyrec](http://0xcc.net/ttyrec/) (plus [html player](http://tty-player.chrismorgan.info/))
+