Skip to content

Instantly share code, notes, and snippets.

View blackzphoenix's full-sized avatar
🎯
Focusing

Black ZPhoenix blackzphoenix

🎯
Focusing
View GitHub Profile
@blackzphoenix
blackzphoenix / 4freedoms.md
Last active April 26, 2020 19:20
Four Freedoms Of Free Software

My Understanding of Four Freedoms of Free Software !!!

Free Software refers to free as in freedom and that's what i too believe in !!!. A free software always should guarantee its users the essential four freedoms. The absence of at least any one of these freedoms means an application is not free software. I love the way the Free Freedoms of Free Software is expressed as - 100 ( in binary 4 ) Freedoms of Free Software.

 FREEDOM 0 :    `001 - USE`
 FREEDOM 1 :    `001 - STUDY`
 FREEDOM 2 :    `001 - SHARE`
 FREEDOM 3 :    `100 - IMPROVE`
@blackzphoenix
blackzphoenix / prob_shell.sh
Last active March 28, 2019 10:53
Problem based on decision
#first
#!/bin/bash -x
echo "Hello ${LOGNAME}"
echo "Today is $(date)"
echo "Users currently on the machine, and their processes:"
#Second
#!/bin/bash
@blackzphoenix
blackzphoenix / shell_scripting.md
Last active March 28, 2019 00:29
Blog on Shell Scripting 0.0

SHELL SCRIPTING 0.0

Shell Scripting is a series of command/s stored in a plain text file and execute the text file instead of typing each command it is Shell Script.

Shell scripts can take input from a user or file and output them to the screen. Whenever one do the same task over and over again, using of shell script automates the repetitive task. Shell acts as a interface between Kernel and User.

@blackzphoenix
blackzphoenix / case2.sh
Last active March 27, 2019 23:55
case programs
file 1: prog.sh
#!/bin/bash
var=$1
case $var in
maths)
echo "In Engineering we have MATHS in 1st to 4th Sem..."
;;
phy)
echo "Luckily or Sadly we have we have PHYSICS only for 1st or 2nd Sem..."
;;
@blackzphoenix
blackzphoenix / case1_shell.sh
Last active March 27, 2019 23:53
case programs
#!/bin/bash
NOW=$(date +"%a")
case $NOW in
Mon)
echo "Full backup", $NOW;;
Tue|Wed|Thu|Fri)
echo "Partial backup", $NOW;;
Sat|Sun)
echo "No backup", $NOW;;
*) ;;
@blackzphoenix
blackzphoenix / case_shell.sh
Last active March 27, 2019 22:24
case statement
case $variable-name in case $variable-name in
pattern1) pattern1|pattern2|pattern3)
command1 command1
... ...
commandN commandN
;; ;;
pattern2) pattern4|pattern5|pattern6)
command1 command1
... ...
commandN commandN
@blackzphoenix
blackzphoenix / para_shell.sh
Last active March 27, 2019 23:46
parameter cal
$* : holds all command line parameters or arguments.
$# : holds the number of positional parameters.
$- : holds flags supplied to the shell.
$? : holds the return value set by the previously executed command.
$$ : holds the process number of the shell (current shell).
$! : hold the process number of the last background command.
$@ : holds all command line parameters or arguments.
#!/bin/bash
IFS="- "
echo "* Display all Free Softwares names using \$@"
echo "$@"
echo
echo "* Display all Free Softwares names using \$*"
echo "$*"
#!/bin/bash
IFS="- "
echo "The script name : $0"
echo "The first argument to the script : $1"
echo "The second argument to the script : $2"
echo "The third argument to the script : $3"
echo "The fourth argument to the script : $4"
echo "The number of arguments passed to the script : $#"
echo "* Display all free Softwares names usinng (\$@ version) : $@"
echo
@blackzphoenix
blackzphoenix / fac_shell.sh
Last active March 27, 2019 23:45
File Attributes Comparison
#File Attributes Comparison are
-a file : True if file exists.
-b file : True if file exists and is a block special file.
-c file : True if file exists and is a character special file.
-d dir : True if file exists and is a directory.
-e file : True if file exists.
-f file : True if file exists and is a regular file.
-g file : True if file exists and is set-group-id.
-h file : True if file exists and is a symbolic link.