Tag Archives: Bash

$@ is not "$@"

when you want to pass multiple parameters through you shell script, you use $@ex: #! /bin/shecho $@ and then execute this file: ./script1 hello world the script will prints “Hello world” But be ware, $@ is not “$@” !! The … Continue reading

Tagged | Leave a comment

pass entire parameters in shell scripts

example bash file: save the following in a file called print.sh#!/bin/bashecho “$@”and then :chmod +x print.sh./print.sh hello worldNote that, all the parameters you pass to print.sh will be passed to echo, this because of “$@”

Tagged | 2 Comments

How to unset an environment variable in Bash

“unset variable_name“

Tagged , , , | Leave a comment

Bash Switch statement

If you have some server that need some script that control it (such as scripts found in /etc/init.d), here’s that script: open a text file and put the following in : #! /bin/shcase "$1" instart) echo "START"; ## command to … Continue reading

Tagged , , | Leave a comment

How to change your current username on Ubuntu Linux

Beware, this action is VERY dangerous and might ruin some of your running applications, I tried it first on a virtual machine and then my actual machine and it messed up 2 or 3 apps only, I was lucky as … Continue reading

Tagged , , , | Leave a comment