Cool Programming Cheat Sheets

If you want quick programming cheat sheets, you need to know what to include with it. This page will help you on some ideas or information that you can include in the cheat sheets.

Cool Programming Cheat Sheet

programming cheat sheets

 

 

programming cheat sheets Basics: For bash programming, the scripts should tell who want to use the interpreter. In the 1st of the line, it must be like this:

#!/bin/bash

It is important to make sure the bash scripts is executable like:
chmod +x filename

Variables: In creating the variable, you just need to assign the value. Keep in mind that the variables are considered non-data types which means it can hold numbers, strings and others without the need to define it.

varname=value

You can access the variable by including $ on front of name. For example:

echo $varname
  • Built-in variables:$1-$N: It will store all of the arguments that are variables being passed to shell program coming from command line
  • $?: It stores exit value that considered last command being executed
  • $0: It stores 1st word of entered command
  • $*: Stores arguments that entered on command line

“$@”: Stores arguments that entered on command line that is individually quoted

File Comparisons:

  • -d filename: Returns the True if the file, if the filename is directory
  • -f filename: Returns the True if the file, if the filename is considered as ordinary file
  • -r filename: Returns the True if the file, if the filename can be read by the process
  • -s filename: Returns the True if the file, if the filename has nonzero length
  • -w filename: Returns the True if the file, if the filename can be written by the process
  • -x filename: Returns the True if the file, if the filename is being executable

String comparisons:

  • str1 = str2: Returns the True if the str1 is being identical to the str2
  • str1 != str2: Returns the True if the str1 is not being identical to the str2
  • str: Returns the True if the str is not null
  • -n str: Returns the True if length of str is being greater than the zero
  • -z str: Returns the True if length of str is being equal to the zero

Numeric Comparisons:

  • int1 -eq int2: Returns the True if the int1 is being equal to the int2
  • int1 -ge int2: Returns the True if the int1 is being greater than or it is equal to the int2
  • int1 -gt int2: Returns the True if the int1 is being greater than the int2
  • int1 -le int2: Returns the True if the int1 is being less than or it is equal to the int2
  • int1 -lt int2: Returns the True if the int1 is being less than the int2
  • int1 -ne int2: Returns the True if the int1 is not being equal to the int2

There you go the web cheat sheet tips that will help you.

Cheat Sheet Template: Programming

Cheat sheet template for programming varies depending on what you want to do. There are numerous codes that you need to do and the presented information are some of the codes that will help you.

How to do a Cheat Sheet Programming

Knowing how to do a cheat is simple if you have all the information needed. What you just need to do is put all information in one page that is organized. You can use tables or bullets to make it easy to read.

If you want to make a unix vi editor cheat sheet, be sure that all information is correct and you organized it in a way that it is easy to understand and remember.

Use our programming cheat sheets today!

References

http://guegue.net/BashProgramming

http://www.linux-sxs.org/programming/bashcheat.html

Download as PDF

Next Post

Previous Post

© 2017 My Cheat Sheet

Theme by Anders Norén