Last active
October 11, 2015 11:29
-
-
Save wcc526/0fc089f89fc6f5a7535a to your computer and use it in GitHub Desktop.
bash tutorial
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
OF=myhome_directory_$(date +%Y%m%d).tar.gz | |
tar -czf $OF /home/linuxconfig | |
#!/bin/bash | |
#Declare array with 4 elements | |
ARRAY=( 'Debian Linux' 'Redhat Linux' Ubuntu Linux ) | |
# get number of elements in the array | |
ELEMENTS=${#ARRAY[@]} | |
# echo each element in array | |
# for loop | |
for (( i=0;i<$ELEMENTS;i++)); do | |
echo ${ARRAY[${i}]} | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment