Just some notes on good practices when shell scripting… It is a good idea to comment your code (this is for programming in general). Have a header with name of script, author, modification date and parameters being used. Variable declaration comments should be on the same line. While other comments can be on a separateContinue reading “Good Shell Scripting Practices”
Tag Archives: bash
Multiple Copies (cp) of a File with Bash
The syntax of the script will be: ./mcp main_file copy1 copy2 copy3 … ./mcp is the script name, main_file is the file that will be copied and copy1, copy2, copy3 and so on are the copies of main_file. I started the script off by getting the main_file in $1 and with shift separating it from the copies: #!/bin/bash file=$1 shift My secondContinue reading “Multiple Copies (cp) of a File with Bash”
Learning Linux: Linux Processes
These notes cover the basics of processes, signals and their control keys and some concept on processes. add & at the end of a command to run the process in the background Process IDs referee to processes in the entire system. Job numbers refers to processes running in the background of the current shell. JobContinue reading “Learning Linux: Linux Processes”
Learning Linux: Bash Command-Line Processing and Input/Output
These notes cover I/O Redirectors, File Descriptors, echo options, printf and read commands, command blocks, Command-Line Processing, how quoting works in bash and the command, builtin, enable and eval commands. I/O Redirectors The I/O Redirectors are >, <, >>, << and |. These are the ones that are most used, the many others are for system programmers.Continue reading “Learning Linux: Bash Command-Line Processing and Input/Output”