Return to Snippet

Revision: 46918
at May 27, 2011 14:18 by mecha


Initial Code
#!/bin/bash

echo "--------------------------------------"
echo "Script name ................... [ $0 ]"
echo "First parameter ............... [ $1 ]"
echo "Second parameter .............. [ $2 ]"
echo "Process ID .................... [ $$ ]"
echo "Parameter count ............... [ $# ]"
echo "All parameters ................ [ $@ ]"
echo "FLAGS ......................... [ $- ]"
echo "--------------------------------------"

# EXAMPLE OUTPUT:
# > ./shell-play-2.sh param1 param2
# --------------------------------------
# Script name ................... [ ./shell-play-2.sh ]
# First Parameter ............... [ param1 ]
# Second Parameter .............. [ param2 ]
# Process ID .................... [ 555 ]
# Parameter Count ............... [ 2 ]
# All Parameters ................ [ param1 param2 ]
# FLAGS ......................... [ hB ]
# --------------------------------------

Initial URL

                                

Initial Description

                                

Initial Title
Shell, Bash script default parameters

Initial Tags
Bash

Initial Language
Bash