SlideShare a Scribd company logo
1 of 10
#!/usr/bin/ksh93
#!/bin/zsh
#!/bin/bash
################################################################
####
#### This script will run in KornShell93, Zshell, or Bash, all you need to do
#### is put the desired "shebang" line at the top of the script.
####
################################################################
function usagemsg_getfilestruct_zbksh {
CMD_ECHO="${GBL_ECHO:-echo -e }"
[[ "_${SHCODE}" == "_korn" ]] && typeset CMD_ECHO="${GBL_ECHO:-echo -e }"
[[ "_${SHCODE}" == "_bash" ]] && declare CMD_ECHO="${GBL_ECHO:-echo -e }"
${CMD_ECHO} ""
${CMD_ECHO} "${1:+Program: ${1}}${2:+ Version: ${2}}"
${CMD_ECHO} ""
${CMD_ECHO} "This script builds arrays of values representing directory and
file"
${CMD_ECHO} "names, with owner, group, and permissions. It will also generate
the"
${CMD_ECHO} "commands necessary to recreate the directory structure, and to
restore"
${CMD_ECHO} "the owner, group, and permissions to all directories and files
under a"
${CMD_ECHO} "top level directory."
${CMD_ECHO} ""
${CMD_ECHO} "Usage: ${1} [-v|-V] [-a] [-c] [-s] [-d|-f] [-R /Alt_Root] TopDir"
${CMD_ECHO} ""
${CMD_ECHO} " Where '-v' = Verbose mode"
${CMD_ECHO} " '-V' = Very Verbose mode"
${CMD_ECHO} " '-a' = Generate Arrays of values as Output"
${CMD_ECHO} " (Default: array definitions)"
${CMD_ECHO} " '-c' = Generate commands to create directory
structures"
${CMD_ECHO} " (Default: array definitions)"
${CMD_ECHO} " '-s' = Generate commands to create Symbolic Links"
${CMD_ECHO} " (Default: OFF)"
${CMD_ECHO} " '-d' = Only gather directory structure information"
${CMD_ECHO} " (Default: Files and Directories)"
${CMD_ECHO} " '-f' = Only gather file information"
${CMD_ECHO} " (Default: Files and Directories)"
${CMD_ECHO} " '-R /ALT_ROOT' = Add an alternate root directory to
every path"
${CMD_ECHO} " This directory does not need to
actually exist"
${CMD_ECHO} " Useful for chroot'ed dirs or ALT_DISK
filesystems"
${CMD_ECHO} " (Default: NUL)"
${CMD_ECHO} ""
${CMD_ECHO} " TopDir = The full path directory name from which to"
${CMD_ECHO} " extract the directory and file structure"
${CMD_ECHO} ""
${CMD_ECHO} "Author: Dana French (dfrench@mtxia.com)"
${CMD_ECHO} "Copyright 2007-2015, All Rights Reserved"
${CMD_ECHO} ""
${CMD_ECHO} ""AutoContent" enabled"
${CMD_ECHO} ""Multi-Shell" enabled"
${CMD_ECHO} ""
}
################################################################
####
#### Description:
####
#### This script builds arrays of values representing directory and file
#### names, with owner, group, and permissions. It will also generate the
#### commands necessary to recreate the directory structure, and to restore
#### the owner, group, and permissions to all directories and files under a
#### top level directory.
####
#### This script can operate in two modes: Array or Command generating.
#### In "Array" mode, KornShell93/Bash code is generated is used
#### to define an array of values containing the directory information
#### and attributes. In "Command" mode, unix style commands are generated
#### to recreate the directory structure and attributes. The default is
#### "Array" mode.
####
#### Assumptions:
####
#### If you are using this script to build arrays of values, it is assumed
#### the number of files in the specified top level directory will be limited
#### on only a few thousand. This is because the values are stored in shell
#### variable arrays which are limited in size, depending upon the platform.
#### You will need to test this on your own system to determine the actual
#### limitations.
####
#### Dependencies:
####
#### This script is dependent upon the following Unix utilities:
#### ksh93, bash, or zsh
#### ls
#### find
#### uname
####
#### Products:
####
#### This script generates KornShell93/Bash Compliant commands that can
#### be used to define an array of values, or this script can generate
#### Unix commands to create the directory structure and its attributes.
####
#### Configured Usage:
####
#### This script can be run from the command line, used as a function, or
#### called from a function library.
####
#### Details:
####
################################################################
function getfilestruct_zbksh
{
if [[ "_${SHCODE}" == "_korn" ]] ||
[[ "_${SHCODE}" == "_zshell" ]]
then
typeset VERSION="3.1-zbksh"
typeset TRUE="${TRUE:-1}"
typeset FALSE="${FALSE:-0}"
typeset CMD_ECHO="${GBL_ECHO:-echo -e }"
typeset VERBOSE="${FALSE}"
typeset VERYVERB="${FALSE}"
typeset GENCMDS="${FALSE}"
typeset GENSLNK="${FALSE}"
typeset GENARYS="${FALSE}"
typeset SHWDIRS="${TRUE}"
typeset SHWFILS="${TRUE}"
typeset DCNT="0"
typeset FCNT="0"
typeset SCNT="0"
typeset ALT_ROOT=""
typeset CMD=""
typeset DGROUP
typeset DIRID1
typeset DIRIDX
typeset DIRNAME
typeset DMODE
typeset DOWNER
typeset GPERMS
typeset LNAME
typeset MACHNAME
typeset OPERMS
typeset PERMS
typeset RAWFNAME
typeset RAWGROUP
typeset RAWOWNER
typeset RAWPERMS
typeset SNAME
typeset UPERMS
elif [[ "_${SHCODE}" == "_bash" ]]
then
declare VERSION="3.1-zbksh"
declare TRUE="${TRUE:-1}"
declare FALSE="${FALSE:-0}"
declare CMD_ECHO="${GBL_ECHO:-echo -e }"
declare VERBOSE="${FALSE}"
declare VERYVERB="${FALSE}"
declare GENCMDS="${FALSE}"
declare GENSLNK="${FALSE}"
declare GENARYS="${FALSE}"
declare SHWDIRS="${TRUE}"
declare SHWFILS="${TRUE}"
declare DCNT="0"
declare FCNT="0"
declare SCNT="0"
declare ALT_ROOT=""
declare CMD=""
declare DGROUP
declare DIRID1
declare DIRIDX
declare DIRNAME
declare DMODE
declare DOWNER
declare GPERMS
declare LNAME
declare MACHNAME
declare OPERMS
declare PERMS
declare RAWFNAME
declare RAWGROUP
declare RAWOWNER
declare RAWPERMS
declare SNAME
declare UPERMS
else
VERSION="3.1-zbksh"
TRUE="${TRUE:-1}"
FALSE="${FALSE:-0}"
CMD_ECHO="${GBL_ECHO:-echo -e }"
VERBOSE="${FALSE}"
VERYVERB="${FALSE}"
GENCMDS="${FALSE}"
GENSLNK="${FALSE}"
GENARYS="${FALSE}"
SHWDIRS="${TRUE}"
SHWFILS="${TRUE}"
DCNT="0"
FCNT="0"
SCNT="0"
ALT_ROOT=""
CMD=""
fi
################################################################
while getopts ":vVcasdfR:" OPTION
do
case "${OPTION}" in
'a') GENARYS="${TRUE}";;
'c') GENCMDS="${TRUE}";;
's') GENSLNK="${TRUE}";;
'd') SHWFILS="${FALSE}";; # Yes, -d turns off showing files
'f') SHWDIRS="${FALSE}";; # Yes, -f turns off showing dirs
'R') ALT_ROOT="${OPTARG}";;
'v') VERBOSE="${TRUE}";;
'V') VERBOSE="${TRUE}"
VERYVERB="${TRUE}";;
'?') usagemsg_getfilestruct_zbksh "${0}" "${VERSION}" && return 1 ;;
esac
done
shift $(( ${OPTIND} - 1 ))
################################################################
trap "usagemsg_getfilestruct_zbksh ${0} ${VERSION} " EXIT
MACHNAME=$( uname -n )
DIRID1="${1:?ERROR: Top level directory not specified}"
if [[ ! -d "${DIRID1}" ]]
then
${CMD_ECHO} "# ERROR: "${DIRID1}" is not a directory or does not exist"
return 4
fi
if (( GENARYS == FALSE )) &&
(( GENCMDS == FALSE ))
then
GENARYS="${TRUE}"
fi
if (( SHWFILS == FALSE )) &&
(( SHWDIRS == FALSE ))
then
${CMD_ECHO} "# ERROR: Do not specify both -d and -f, you must specify one or
the other, or neither."
return 2
fi
trap "-" EXIT
################################################################
DCNT="0"
FCNT="0"
SCNT="0"
DIRIDX="${DIRID1##*/}"
(( ${#DIRIDX} > 8 )) && DIRIDX="${DIRIDX:0:8}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "${SHEBANG:-#!/usr/bin/ksh93}"
(( VERBOSE == TRUE )) && ${CMD_ECHO}
"################################################################"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Program Name..........: ${0}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Version...............: ${VERSION}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Script Execution Mode.: ${SHCODE}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Copyright Info........: Copyright 2007-
2015 by Dana French, All Rights Reserved"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Local hostname........: ${MACHNAME}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Top Level Directory...: ${DIRID1}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "# Variable index name...: ${DIRIDX}"
(( VERBOSE == TRUE )) && (( SHWFILS == TRUE )) && ${CMD_ECHO} "# Show
Files............: TRUE"
(( VERBOSE == TRUE )) && (( SHWFILS == FALSE )) && ${CMD_ECHO} "# Show
Files............: FALSE"
(( VERBOSE == TRUE )) && (( SHWDIRS == TRUE )) && ${CMD_ECHO} "# Show
Directories......: TRUE"
(( VERBOSE == TRUE )) && (( SHWDIRS == FALSE )) && ${CMD_ECHO} "# Show
Directories......: FALSE"
(( VERBOSE == TRUE )) && (( GENCMDS == TRUE )) && ${CMD_ECHO} "# Generate
Commands.....: TRUE"
(( VERBOSE == TRUE )) && (( GENCMDS == FALSE )) && ${CMD_ECHO} "# Generate
Commands.....: FALSE"
(( VERBOSE == TRUE )) && (( GENARYS == TRUE )) && ${CMD_ECHO} "# Generate
Arrays.......: TRUE"
(( VERBOSE == TRUE )) && (( GENARYS == FALSE )) && ${CMD_ECHO} "# Generate
Arrays.......: FALSE"
(( VERBOSE == TRUE )) && (( GENSLNK == TRUE )) && ${CMD_ECHO} "# Generate Sym
Link CMDS: TRUE"
(( VERBOSE == TRUE )) && (( GENSLNK == FALSE )) && ${CMD_ECHO} "# Generate Sym
Link CMDS: FALSE"
${CMD_ECHO} ""
${CMD_ECHO} "ALT_ROOT="${ALT_ROOT}""
################################################################
####
#### The first thing the "getfilestruct" script does is to execute a "find"
#### command to retrieve all the directories under the top level directory
#### specified on the command line when the script was run. The "find"
#### command produces "ls -ld" style output for the purpose of extracting and
#### processing the attributes associated with each directory.
####
################################################################
(( SHWFILS == FALSE )) && (( SHWDIRS == TRUE )) && CMD='find "${DIRID1%/}"
-type d -exec ls -ld {} ;'
(( SHWFILS == TRUE )) && (( SHWDIRS == FALSE )) && CMD='find "${DIRID1%/}" !
-type d -exec ls -ld {} ;'
(( SHWFILS == TRUE )) && (( SHWDIRS == TRUE )) && CMD='find "${DIRID1%/}"
-exec ls -ld {} ;'
(( SHWFILS == FALSE )) && (( SHWDIRS == FALSE )) && return 3
eval ${CMD} | while read -r -- RAWPERMS RAWLINKS RAWOWNER RAWGROUP RAWSIZE
RAWDATE1 RAWDATE2 RAWDATE3 RAWFNAME
do
################################################################
####
#### If the file is a symbolic link, generate the command to recreate the
#### symbolic link and continue with the next file.
####
################################################################
if [[ "_${RAWPERMS}" == _l* ]]
then
LNAME="${RAWFNAME##* -> }"
SNAME="${RAWFNAME% -> *}"
[[ "_${LNAME}" != _/* ]] && LNAME="${SNAME%/*}/${LNAME}"
if (( GENARYS == TRUE ))
then
${CMD_ECHO} "n#### symbolic link "${RAWFNAME}""
${CMD_ECHO} "SYM_${DIRIDX}_SNAME[${SCNT}]="${ALT_ROOT}${SNAME}""
${CMD_ECHO} "SYM_${DIRIDX}_FLINK[${SCNT}]="${ALT_ROOT}${LNAME}""
SCNT=$(( ${SCNT} + 1 ))
fi
if (( GENSLNK == TRUE ))
then
${CMD_ECHO} "n#### Generate symbolic link "${RAWFNAME}""
${CMD_ECHO} "ln -s "${LNAME}" "${SNAME}""
else
${CMD_ECHO} "n#### Skipping symbolic link "${RAWFNAME}""
${CMD_ECHO} "# ln -s "${LNAME}" "${SNAME}""
fi
continue
fi
################################################################
####
#### The file owner and group are easily
#### extracted from the "ls -ld" output, however the permissions require
#### some processing.
####
################################################################
# extract the owner for the directory from the ls -l output
DOWNER="${RAWOWNER}"
# extract the group for the directory from the ls -l output
DGROUP="${RAWGROUP}"
# extract the permission settings for the directory from the ls -l output
PERMS="${RAWPERMS:1:9}"
# extract the name of the directory from the ls -l output
DIRNAME="${RAWFNAME}"
[[ "_${DIRNAME}" == *lost+found ]] && continue
################################################################
####
#### The permission settings are contained within the first 10 characters
#### of the "ls -ld" output and are processed in 3 steps. The first character
#### is the file type and is ignored, the next 3 characters are associated
#### with the "user" or file owner permissions. The permissions are
#### checked to see if the tacky bit or SUID bit is set. If so
#### the appropriate permission setting is added to the permission string
#### which will be used when directory permissions are set.
####
################################################################
# extract the user permission settings for the directory from the ls -ld output
UPERMS="${PERMS:0:3}"
# remove the dashes "-" from the user permissions
UPERMS="${UPERMS//-/}"
# Convert lowercase "s" to "xs" in the user permissions
UPERMS="${UPERMS//s/xs}"
# Convert uppercase "S" to "s" in the user permissions
UPERMS="${UPERMS//S/s}"
# Convert lowercase "t" to "xt" in the user permissions
UPERMS="${UPERMS//t/xt}"
# Convert uppercase "T" to "t" in the user permissions
UPERMS="${UPERMS//T/t}"
################################################################
####
#### The next set of 3 characters are associated with the "group"
#### category of permissions. The permissions are checked to see
#### if the tacky bit or SUID bit is set. If so the appropriate
#### permission setting is added to the permission string which will
#### be used when the directory permissions are set.
####
################################################################
# extract the group permission settings for the directory from the ls -ld output
GPERMS="${PERMS:3:3}"
# remove the dashes "-" from the group permissions
GPERMS="${GPERMS//-/}"
# Convert lowercase "s" to "xs" in the group permissions
GPERMS="${GPERMS//s/xs}"
# Convert uppercase "S" to "s" in the group permissions
GPERMS="${GPERMS//S/s}"
# Convert lowercase "t" to "xt" in the group permissions
GPERMS="${GPERMS//t/xt}"
# Convert uppercase "T" to "t" in the group permissions
GPERMS="${GPERMS//T/t}"
################################################################
####
#### The last set of 3 characters are associated with the "other"
#### category of permissions. Again, the permissions are checked to see
#### if the tacky bit or SUID bit is set. If so the appropriate permission
#### setting is added to the permission string which will be used when the
#### directory permissions are set.
####
################################################################
# extract the other permission settings for the directory from the ls -ld output
OPERMS="${PERMS:6:3}"
# remove the dashes "-" from the other permissions
OPERMS="${OPERMS//-/}"
# Convert lowercase "s" to "xs" in the other permissions
OPERMS="${OPERMS//s/xs}"
# Convert uppercase "S" to "s" in the other permissions
OPERMS="${OPERMS//S/s}"
# Convert lowercase "t" to "xt" in the other permissions
OPERMS="${OPERMS//t/xt}"
# Convert uppercase "T" to "t" in the other permissions
OPERMS="${OPERMS//T/t}"
################################################################
####
#### With the permission setting strings for each user category now known
#### and extracted from the "ls -ld" output, a mnemonic "exact setting"
#### string is constructed for use with the "chmod" command.
####
################################################################
# Build the mnemonic mode exact permission setting command
DMODE="u=${UPERMS},g=${GPERMS},o=${OPERMS}"
(( VERBOSE == TRUE )) && ${CMD_ECHO} "n#### n#### ${MACHNAME}:${DMODE}:$
{DOWNER}:${DGROUP}:${DIRNAME}"
################################################################
#### Depending upon the options specified when this script was run,
#### either KornShell93/Bash compliant commands or Unix commands will
#### be generated.
####
#### The generated KornShell93/Bash Compliant commands can be used to
#### define a variable array of values which contain the directory name
#### and various attributes associated with each directory.
####
#### The Unix commands generated consist of mkdir, chown, chgrp, and
#### chmod, which can be used to create the directory and change its
#### attributes to match those of the original directory.
####
################################################################
if [[ -d "${DIRNAME}" ]]
then
(( VERBOSE == TRUE )) && ${CMD_ECHO} "n${CMD_ECHO} "# Working on $
{DIRNAME}""
if (( GENARYS == TRUE ))
then
${CMD_ECHO} "DIR_${DIRIDX}_DNAME[${DCNT}]="${ALT_ROOT}$
{DIRNAME}";"
${CMD_ECHO} "DIR_${DIRIDX}_OWNER[${DCNT}]="${DOWNER}";"
${CMD_ECHO} "DIR_${DIRIDX}_GROUP[${DCNT}]="${DGROUP}";"
${CMD_ECHO} "DIR_${DIRIDX}_CHMOD[${DCNT}]="${DMODE}";"
fi
if (( GENCMDS == TRUE ))
then
${CMD_ECHO} "mkdir -p "${ALT_ROOT}${DIRNAME}";"
${CMD_ECHO} "chown ${DOWNER} "${ALT_ROOT}${DIRNAME}";"
${CMD_ECHO} "chgrp ${DGROUP} "${ALT_ROOT}${DIRNAME}";"
${CMD_ECHO} "chmod "${DMODE}" "${ALT_ROOT}${DIRNAME}";"
fi
DCNT=$(( ${DCNT} + 1 ))
else
if (( GENARYS == TRUE ))
then
${CMD_ECHO} "FIL_${DIRIDX}_FNAME[${FCNT}]="${ALT_ROOT}$
{DIRNAME}";"
${CMD_ECHO} "FIL_${DIRIDX}_OWNER[${FCNT}]="${DOWNER}";"
${CMD_ECHO} "FIL_${DIRIDX}_GROUP[${FCNT}]="${DGROUP}";"
${CMD_ECHO} "FIL_${DIRIDX}_CHMOD[${FCNT}]="${DMODE}";"
fi
if (( GENCMDS == TRUE ))
then
${CMD_ECHO} "chown ${DOWNER} "${ALT_ROOT}${DIRNAME}";"
${CMD_ECHO} "chgrp ${DGROUP} "${ALT_ROOT}${DIRNAME}";"
${CMD_ECHO} "chmod "${DMODE}" "${ALT_ROOT}${DIRNAME}";"
fi
FCNT=$(( ${FCNT} + 1 ))
fi
done
return 0
}
################################################################
################################################################
################################################################
####
#### Main Body of Script Begins Here
####
################################################################
TRUE="1"
FALSE="0"
####
#### Extract the "shebang" line from the beginning of the script
read SHEBANG < "${0}"
export SHEBANG
####
#### Test the "shebang" line to determine what shell interpreter is specified
SHCODE="unknown"
[[ "_${SHEBANG}" == _*/ksh* ]] && SHCODE="korn"
[[ "_${SHEBANG}" == _*/bash* ]] && SHCODE="bash"
[[ "_${SHEBANG}" == _*/zsh* ]] && SHCODE="zshell"
export SHCODE
####
#### Modify the commands and script according to the shell intpreter
GBL_ECHO="echo -e"
[[ "_${SHCODE}" == "_korn" ]] && GBL_ECHO="print --"
[[ "_${SHCODE}" == "_zshell" ]] && GBL_ECHO="print --" && emulate ksh93
[[ "_${SHCODE}" == "_bash" ]] && shopt -s extglob # Turn on extended
globbing
####
#### Call the script function to begin processing
getfilestruct_zbksh "${@}"
exit ${?}
fi
FCNT=$(( ${FCNT} + 1 ))
fi
done
return 0
}
################################################################
################################################################
################################################################
####
#### Main Body of Script Begins Here
####
################################################################
TRUE="1"
FALSE="0"
####
#### Extract the "shebang" line from the beginning of the script
read SHEBANG < "${0}"
export SHEBANG
####
#### Test the "shebang" line to determine what shell interpreter is specified
SHCODE="unknown"
[[ "_${SHEBANG}" == _*/ksh* ]] && SHCODE="korn"
[[ "_${SHEBANG}" == _*/bash* ]] && SHCODE="bash"
[[ "_${SHEBANG}" == _*/zsh* ]] && SHCODE="zshell"
export SHCODE
####
#### Modify the commands and script according to the shell intpreter
GBL_ECHO="echo -e"
[[ "_${SHCODE}" == "_korn" ]] && GBL_ECHO="print --"
[[ "_${SHCODE}" == "_zshell" ]] && GBL_ECHO="print --" && emulate ksh93
[[ "_${SHCODE}" == "_bash" ]] && shopt -s extglob # Turn on extended
globbing
####
#### Call the script function to begin processing
getfilestruct_zbksh "${@}"
exit ${?}

More Related Content

What's hot

Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10minIvelina Dimova
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Michael Schwern
 
Bringing Characters to Life for Immersive Storytelling - Dioselin Gonzalez
Bringing Characters to Life for Immersive Storytelling - Dioselin GonzalezBringing Characters to Life for Immersive Storytelling - Dioselin Gonzalez
Bringing Characters to Life for Immersive Storytelling - Dioselin GonzalezWithTheBest
 
The linux command line for total beginners
The linux command line  for total beginnersThe linux command line  for total beginners
The linux command line for total beginnersCorrie Watt
 
How to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainHow to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainCodemotion Tel Aviv
 
Linux Command Line Introduction for total beginners, Part 2
Linux Command Line Introduction for total beginners, Part 2 Linux Command Line Introduction for total beginners, Part 2
Linux Command Line Introduction for total beginners, Part 2 Corrie Watt
 
Micropage in microtime using microframework
Micropage in microtime using microframeworkMicropage in microtime using microframework
Micropage in microtime using microframeworkRadek Benkel
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con RailsSvet Ivantchev
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shellady36
 
PythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみたPythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみたitoxdev
 
全裸でワンライナー(仮)
全裸でワンライナー(仮)全裸でワンライナー(仮)
全裸でワンライナー(仮)Yoshihiro Sugi
 
Patrick Kettner - Creating magic with houdini
Patrick Kettner - Creating magic with houdiniPatrick Kettner - Creating magic with houdini
Patrick Kettner - Creating magic with houdiniOdessaJS Conf
 

What's hot (20)

Php My Sql
Php My SqlPhp My Sql
Php My Sql
 
Lettering js
Lettering jsLettering js
Lettering js
 
Make your own wp cli command in 10min
Make your own wp cli command in 10minMake your own wp cli command in 10min
Make your own wp cli command in 10min
 
Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)Simple Ways To Be A Better Programmer (OSCON 2007)
Simple Ways To Be A Better Programmer (OSCON 2007)
 
Bringing Characters to Life for Immersive Storytelling - Dioselin Gonzalez
Bringing Characters to Life for Immersive Storytelling - Dioselin GonzalezBringing Characters to Life for Immersive Storytelling - Dioselin Gonzalez
Bringing Characters to Life for Immersive Storytelling - Dioselin Gonzalez
 
The linux command line for total beginners
The linux command line  for total beginnersThe linux command line  for total beginners
The linux command line for total beginners
 
Advanced Shell Scripting
Advanced Shell ScriptingAdvanced Shell Scripting
Advanced Shell Scripting
 
How to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrainHow to actually use promises - Jakob Mattsson, FishBrain
How to actually use promises - Jakob Mattsson, FishBrain
 
Linux Command Line Introduction for total beginners, Part 2
Linux Command Line Introduction for total beginners, Part 2 Linux Command Line Introduction for total beginners, Part 2
Linux Command Line Introduction for total beginners, Part 2
 
Micropage in microtime using microframework
Micropage in microtime using microframeworkMicropage in microtime using microframework
Micropage in microtime using microframework
 
Interface de Voz con Rails
Interface de Voz con RailsInterface de Voz con Rails
Interface de Voz con Rails
 
Speeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorallSpeeding up Red Team engagements with carnivorall
Speeding up Red Team engagements with carnivorall
 
DOS
DOSDOS
DOS
 
Itsecteam shell
Itsecteam shellItsecteam shell
Itsecteam shell
 
PythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみたPythonでJWT生成からボット作成、投稿までやってみた
PythonでJWT生成からボット作成、投稿までやってみた
 
Theming and Sass
Theming and SassTheming and Sass
Theming and Sass
 
Pecha Kucha
Pecha KuchaPecha Kucha
Pecha Kucha
 
Ubi comp27nov04
Ubi comp27nov04Ubi comp27nov04
Ubi comp27nov04
 
全裸でワンライナー(仮)
全裸でワンライナー(仮)全裸でワンライナー(仮)
全裸でワンライナー(仮)
 
Patrick Kettner - Creating magic with houdini
Patrick Kettner - Creating magic with houdiniPatrick Kettner - Creating magic with houdini
Patrick Kettner - Creating magic with houdini
 

Viewers also liked

Analysis of the Performance of Sea Level Stations at Haiti
Analysis of the Performance of Sea Level Stations at HaitiAnalysis of the Performance of Sea Level Stations at Haiti
Analysis of the Performance of Sea Level Stations at HaitiKaruska Matos-Horta
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate shBen Pope
 
Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Ben Pope
 
Mkscript sh
Mkscript shMkscript sh
Mkscript shBen Pope
 
An a z index of the bash commands
An a z index of the bash commandsAn a z index of the bash commands
An a z index of the bash commandsBen Pope
 
Applecmdlista zs
Applecmdlista zsApplecmdlista zs
Applecmdlista zsBen Pope
 
Xz file-format-1.0.4
Xz file-format-1.0.4Xz file-format-1.0.4
Xz file-format-1.0.4Ben Pope
 
An a z index of windows power shell commandss
An a z index of windows power shell commandssAn a z index of windows power shell commandss
An a z index of windows power shell commandssBen Pope
 
Compound var
Compound varCompound var
Compound varBen Pope
 

Viewers also liked (16)

Pop3ck sh
Pop3ck shPop3ck sh
Pop3ck sh
 
Analysis of the Performance of Sea Level Stations at Haiti
Analysis of the Performance of Sea Level Stations at HaitiAnalysis of the Performance of Sea Level Stations at Haiti
Analysis of the Performance of Sea Level Stations at Haiti
 
Logrotate sh
Logrotate shLogrotate sh
Logrotate sh
 
Getfilestruct zbksh(1)
Getfilestruct zbksh(1)Getfilestruct zbksh(1)
Getfilestruct zbksh(1)
 
Mkscript sh
Mkscript shMkscript sh
Mkscript sh
 
Firewall
FirewallFirewall
Firewall
 
Slowinski_Portfolio
Slowinski_PortfolioSlowinski_Portfolio
Slowinski_Portfolio
 
Diplom
DiplomDiplom
Diplom
 
An a z index of the bash commands
An a z index of the bash commandsAn a z index of the bash commands
An a z index of the bash commands
 
Stefanie Lopez Angel - PPP Final
Stefanie Lopez Angel - PPP FinalStefanie Lopez Angel - PPP Final
Stefanie Lopez Angel - PPP Final
 
Applecmdlista zs
Applecmdlista zsApplecmdlista zs
Applecmdlista zs
 
Xz file-format-1.0.4
Xz file-format-1.0.4Xz file-format-1.0.4
Xz file-format-1.0.4
 
An a z index of windows power shell commandss
An a z index of windows power shell commandssAn a z index of windows power shell commandss
An a z index of windows power shell commandss
 
Compound var
Compound varCompound var
Compound var
 
Cuadro sipnotico
Cuadro sipnoticoCuadro sipnotico
Cuadro sipnotico
 
Pcad mision sucre
Pcad mision sucrePcad mision sucre
Pcad mision sucre
 

Similar to Getfilestruct zbksh

De 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWKDe 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWKAdolfo Sanz De Diego
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2ady36
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless FunctionMichael Adda
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)Chhom Karath
 
Face detection myriad_批次檔
Face detection myriad_批次檔Face detection myriad_批次檔
Face detection myriad_批次檔MAKERPRO.cc
 
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy TerraformPrzemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraformjzielinski_pl
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applicationselliando dias
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricksambiescent
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TracerySarah Sexton
 
Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkSarah Sexton
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Coxlachie
 
RubyEnRails2007 - Dr Nic Williams - DIY Syntax
RubyEnRails2007 - Dr Nic Williams - DIY SyntaxRubyEnRails2007 - Dr Nic Williams - DIY Syntax
RubyEnRails2007 - Dr Nic Williams - DIY SyntaxDr Nic Williams
 
alfresco-global.properties
alfresco-global.propertiesalfresco-global.properties
alfresco-global.propertiestechecm
 
alfresco-global.properties
alfresco-global.propertiesalfresco-global.properties
alfresco-global.propertiestechecm
 

Similar to Getfilestruct zbksh (20)

My shell
My shellMy shell
My shell
 
De 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWKDe 0 a 100 con Bash Shell Scripting y AWK
De 0 a 100 con Bash Shell Scripting y AWK
 
R57php 1231677414471772-2
R57php 1231677414471772-2R57php 1231677414471772-2
R57php 1231677414471772-2
 
A Self Replicating Serverless Function
A Self Replicating Serverless FunctionA Self Replicating Serverless Function
A Self Replicating Serverless Function
 
Ch1(introduction to php)
Ch1(introduction to php)Ch1(introduction to php)
Ch1(introduction to php)
 
What is a shell script
What is a shell scriptWhat is a shell script
What is a shell script
 
Face detection myriad_批次檔
Face detection myriad_批次檔Face detection myriad_批次檔
Face detection myriad_批次檔
 
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy TerraformPrzemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
Przemysław Iwanek - ABC AWS, budowanie infrastruktury przy pomocy Terraform
 
clonehd01
clonehd01clonehd01
clonehd01
 
PHP and Rich Internet Applications
PHP and Rich Internet ApplicationsPHP and Rich Internet Applications
PHP and Rich Internet Applications
 
PHP code examples
PHP code examplesPHP code examples
PHP code examples
 
Postman On Steroids
Postman On SteroidsPostman On Steroids
Postman On Steroids
 
Cheap frontend tricks
Cheap frontend tricksCheap frontend tricks
Cheap frontend tricks
 
Word Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with TraceryWord Play in the Digital Age: Building Text Bots with Tracery
Word Play in the Digital Age: Building Text Bots with Tracery
 
Getting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot FrameworkGetting Started with Microsoft Bot Framework
Getting Started with Microsoft Bot Framework
 
Blocks by Lachs Cox
Blocks by Lachs CoxBlocks by Lachs Cox
Blocks by Lachs Cox
 
RubyEnRails2007 - Dr Nic Williams - DIY Syntax
RubyEnRails2007 - Dr Nic Williams - DIY SyntaxRubyEnRails2007 - Dr Nic Williams - DIY Syntax
RubyEnRails2007 - Dr Nic Williams - DIY Syntax
 
Bash 4
Bash 4Bash 4
Bash 4
 
alfresco-global.properties
alfresco-global.propertiesalfresco-global.properties
alfresco-global.properties
 
alfresco-global.properties
alfresco-global.propertiesalfresco-global.properties
alfresco-global.properties
 

More from Ben Pope

Programming collaborative-ref
Programming collaborative-refProgramming collaborative-ref
Programming collaborative-refBen Pope
 
Popstat1 sh
Popstat1 shPopstat1 sh
Popstat1 shBen Pope
 
Pop3stat sh
Pop3stat shPop3stat sh
Pop3stat shBen Pope
 
Menu func-sh
Menu func-shMenu func-sh
Menu func-shBen Pope
 
Menu func-sh(1)
Menu func-sh(1)Menu func-sh(1)
Menu func-sh(1)Ben Pope
 

More from Ben Pope (9)

Programming collaborative-ref
Programming collaborative-refProgramming collaborative-ref
Programming collaborative-ref
 
Popstat1 sh
Popstat1 shPopstat1 sh
Popstat1 sh
 
Pop3stat sh
Pop3stat shPop3stat sh
Pop3stat sh
 
Phadd sh
Phadd shPhadd sh
Phadd sh
 
Phdel sh
Phdel shPhdel sh
Phdel sh
 
Menu func-sh
Menu func-shMenu func-sh
Menu func-sh
 
Menu func-sh(1)
Menu func-sh(1)Menu func-sh(1)
Menu func-sh(1)
 
Luhn sh
Luhn shLuhn sh
Luhn sh
 
Cpsh sh
Cpsh shCpsh sh
Cpsh sh
 

Recently uploaded

(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service
(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service
(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭o8wvnojp
 
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一Fi sss
 
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptx
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptxChocolate Milk Flavorful Indulgence to RD UHT Innovations.pptx
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptxRD Food
 
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
BPP NC II Lesson 3 - Pastry Products.pptx
BPP NC II Lesson 3 - Pastry Products.pptxBPP NC II Lesson 3 - Pastry Products.pptx
BPP NC II Lesson 3 - Pastry Products.pptxmaricel769799
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...ranjana rawat
 
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝soniya singh
 
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...dollysharma2066
 
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130Suhani Kapoor
 
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...dollysharma2066
 
thanksgiving dinner and more information
thanksgiving dinner and more informationthanksgiving dinner and more information
thanksgiving dinner and more informationlialiaskou00
 
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service NashikRussian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashikranjana rawat
 
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashikranjana rawat
 
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Serviceranjana rawat
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsCall Girls in Nagpur High Profile
 
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...Suhani Kapoor
 
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012rehmti665
 

Recently uploaded (20)

Dwarka Sector 16 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 16 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...Dwarka Sector 16 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
Dwarka Sector 16 Call Girls | Delhi | 9999965857 🫦 Vanshika Verma More Our Se...
 
(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service
(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service
(SUNAINA) Call Girls Alandi Road ( 7001035870 ) HI-Fi Pune Escorts Service
 
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭
咨询办理南卡罗来纳大学毕业证成绩单SC毕业文凭
 
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
(办理学位证)加州大学圣塔芭芭拉分校毕业证成绩单原版一比一
 
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptx
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptxChocolate Milk Flavorful Indulgence to RD UHT Innovations.pptx
Chocolate Milk Flavorful Indulgence to RD UHT Innovations.pptx
 
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service
(PRIYA) Call Girls Budhwar Peth ( 7001035870 ) HI-Fi Pune Escorts Service
 
BPP NC II Lesson 3 - Pastry Products.pptx
BPP NC II Lesson 3 - Pastry Products.pptxBPP NC II Lesson 3 - Pastry Products.pptx
BPP NC II Lesson 3 - Pastry Products.pptx
 
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
(PRIYANKA) Katraj Call Girls Just Call 7001035870 [ Cash on Delivery ] Pune E...
 
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝
Call Girls in Ghitorni Delhi 💯Call Us 🔝8264348440🔝
 
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...
Russian Escorts DELHI - Russian Call Girls in Delhi Greater Kailash TELL-NO. ...
 
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
VIP Call Girls Service Shamshabad Hyderabad Call +91-8250192130
 
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
Affordable PriceD Call Girls In Crowne Plaza Greater Noida 8377877756 Short 2...
 
thanksgiving dinner and more information
thanksgiving dinner and more informationthanksgiving dinner and more information
thanksgiving dinner and more information
 
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service NashikRussian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
Russian Call Girls in Nashik Riya 7001305949 Independent Escort Service Nashik
 
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service NashikHigh Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
High Class Call Girls Nashik Priya 7001305949 Independent Escort Service Nashik
 
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service
(ISHITA) Call Girls Manchar ( 7001035870 ) HI-Fi Pune Escorts Service
 
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur EscortsRussian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
Russian Call Girls in Nagpur Devyani Call 7001035870 Meet With Nagpur Escorts
 
young Whatsapp Call Girls in Jamuna Vihar 🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Jamuna Vihar 🔝 9953056974 🔝 escort serviceyoung Whatsapp Call Girls in Jamuna Vihar 🔝 9953056974 🔝 escort service
young Whatsapp Call Girls in Jamuna Vihar 🔝 9953056974 🔝 escort service
 
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...
VIP Russian Call Girls in Noida Deepika 8250192130 Independent Escort Service...
 
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
Call Girls Laxmi Nagar Delhi reach out to us at ☎ 9711199012
 

Getfilestruct zbksh

  • 1. #!/usr/bin/ksh93 #!/bin/zsh #!/bin/bash ################################################################ #### #### This script will run in KornShell93, Zshell, or Bash, all you need to do #### is put the desired "shebang" line at the top of the script. #### ################################################################ function usagemsg_getfilestruct_zbksh { CMD_ECHO="${GBL_ECHO:-echo -e }" [[ "_${SHCODE}" == "_korn" ]] && typeset CMD_ECHO="${GBL_ECHO:-echo -e }" [[ "_${SHCODE}" == "_bash" ]] && declare CMD_ECHO="${GBL_ECHO:-echo -e }" ${CMD_ECHO} "" ${CMD_ECHO} "${1:+Program: ${1}}${2:+ Version: ${2}}" ${CMD_ECHO} "" ${CMD_ECHO} "This script builds arrays of values representing directory and file" ${CMD_ECHO} "names, with owner, group, and permissions. It will also generate the" ${CMD_ECHO} "commands necessary to recreate the directory structure, and to restore" ${CMD_ECHO} "the owner, group, and permissions to all directories and files under a" ${CMD_ECHO} "top level directory." ${CMD_ECHO} "" ${CMD_ECHO} "Usage: ${1} [-v|-V] [-a] [-c] [-s] [-d|-f] [-R /Alt_Root] TopDir" ${CMD_ECHO} "" ${CMD_ECHO} " Where '-v' = Verbose mode" ${CMD_ECHO} " '-V' = Very Verbose mode" ${CMD_ECHO} " '-a' = Generate Arrays of values as Output" ${CMD_ECHO} " (Default: array definitions)" ${CMD_ECHO} " '-c' = Generate commands to create directory structures" ${CMD_ECHO} " (Default: array definitions)" ${CMD_ECHO} " '-s' = Generate commands to create Symbolic Links" ${CMD_ECHO} " (Default: OFF)" ${CMD_ECHO} " '-d' = Only gather directory structure information" ${CMD_ECHO} " (Default: Files and Directories)" ${CMD_ECHO} " '-f' = Only gather file information" ${CMD_ECHO} " (Default: Files and Directories)" ${CMD_ECHO} " '-R /ALT_ROOT' = Add an alternate root directory to every path" ${CMD_ECHO} " This directory does not need to actually exist" ${CMD_ECHO} " Useful for chroot'ed dirs or ALT_DISK filesystems" ${CMD_ECHO} " (Default: NUL)" ${CMD_ECHO} "" ${CMD_ECHO} " TopDir = The full path directory name from which to" ${CMD_ECHO} " extract the directory and file structure" ${CMD_ECHO} "" ${CMD_ECHO} "Author: Dana French (dfrench@mtxia.com)" ${CMD_ECHO} "Copyright 2007-2015, All Rights Reserved" ${CMD_ECHO} "" ${CMD_ECHO} ""AutoContent" enabled" ${CMD_ECHO} ""Multi-Shell" enabled" ${CMD_ECHO} "" } ################################################################ #### #### Description: #### #### This script builds arrays of values representing directory and file
  • 2. #### names, with owner, group, and permissions. It will also generate the #### commands necessary to recreate the directory structure, and to restore #### the owner, group, and permissions to all directories and files under a #### top level directory. #### #### This script can operate in two modes: Array or Command generating. #### In "Array" mode, KornShell93/Bash code is generated is used #### to define an array of values containing the directory information #### and attributes. In "Command" mode, unix style commands are generated #### to recreate the directory structure and attributes. The default is #### "Array" mode. #### #### Assumptions: #### #### If you are using this script to build arrays of values, it is assumed #### the number of files in the specified top level directory will be limited #### on only a few thousand. This is because the values are stored in shell #### variable arrays which are limited in size, depending upon the platform. #### You will need to test this on your own system to determine the actual #### limitations. #### #### Dependencies: #### #### This script is dependent upon the following Unix utilities: #### ksh93, bash, or zsh #### ls #### find #### uname #### #### Products: #### #### This script generates KornShell93/Bash Compliant commands that can #### be used to define an array of values, or this script can generate #### Unix commands to create the directory structure and its attributes. #### #### Configured Usage: #### #### This script can be run from the command line, used as a function, or #### called from a function library. #### #### Details: #### ################################################################ function getfilestruct_zbksh { if [[ "_${SHCODE}" == "_korn" ]] || [[ "_${SHCODE}" == "_zshell" ]] then typeset VERSION="3.1-zbksh" typeset TRUE="${TRUE:-1}" typeset FALSE="${FALSE:-0}" typeset CMD_ECHO="${GBL_ECHO:-echo -e }" typeset VERBOSE="${FALSE}" typeset VERYVERB="${FALSE}" typeset GENCMDS="${FALSE}" typeset GENSLNK="${FALSE}" typeset GENARYS="${FALSE}" typeset SHWDIRS="${TRUE}" typeset SHWFILS="${TRUE}" typeset DCNT="0" typeset FCNT="0" typeset SCNT="0" typeset ALT_ROOT=""
  • 3. typeset CMD="" typeset DGROUP typeset DIRID1 typeset DIRIDX typeset DIRNAME typeset DMODE typeset DOWNER typeset GPERMS typeset LNAME typeset MACHNAME typeset OPERMS typeset PERMS typeset RAWFNAME typeset RAWGROUP typeset RAWOWNER typeset RAWPERMS typeset SNAME typeset UPERMS elif [[ "_${SHCODE}" == "_bash" ]] then declare VERSION="3.1-zbksh" declare TRUE="${TRUE:-1}" declare FALSE="${FALSE:-0}" declare CMD_ECHO="${GBL_ECHO:-echo -e }" declare VERBOSE="${FALSE}" declare VERYVERB="${FALSE}" declare GENCMDS="${FALSE}" declare GENSLNK="${FALSE}" declare GENARYS="${FALSE}" declare SHWDIRS="${TRUE}" declare SHWFILS="${TRUE}" declare DCNT="0" declare FCNT="0" declare SCNT="0" declare ALT_ROOT="" declare CMD="" declare DGROUP declare DIRID1 declare DIRIDX declare DIRNAME declare DMODE declare DOWNER declare GPERMS declare LNAME declare MACHNAME declare OPERMS declare PERMS declare RAWFNAME declare RAWGROUP declare RAWOWNER declare RAWPERMS declare SNAME declare UPERMS else VERSION="3.1-zbksh" TRUE="${TRUE:-1}" FALSE="${FALSE:-0}" CMD_ECHO="${GBL_ECHO:-echo -e }" VERBOSE="${FALSE}" VERYVERB="${FALSE}" GENCMDS="${FALSE}" GENSLNK="${FALSE}" GENARYS="${FALSE}" SHWDIRS="${TRUE}"
  • 4. SHWFILS="${TRUE}" DCNT="0" FCNT="0" SCNT="0" ALT_ROOT="" CMD="" fi ################################################################ while getopts ":vVcasdfR:" OPTION do case "${OPTION}" in 'a') GENARYS="${TRUE}";; 'c') GENCMDS="${TRUE}";; 's') GENSLNK="${TRUE}";; 'd') SHWFILS="${FALSE}";; # Yes, -d turns off showing files 'f') SHWDIRS="${FALSE}";; # Yes, -f turns off showing dirs 'R') ALT_ROOT="${OPTARG}";; 'v') VERBOSE="${TRUE}";; 'V') VERBOSE="${TRUE}" VERYVERB="${TRUE}";; '?') usagemsg_getfilestruct_zbksh "${0}" "${VERSION}" && return 1 ;; esac done shift $(( ${OPTIND} - 1 )) ################################################################ trap "usagemsg_getfilestruct_zbksh ${0} ${VERSION} " EXIT MACHNAME=$( uname -n ) DIRID1="${1:?ERROR: Top level directory not specified}" if [[ ! -d "${DIRID1}" ]] then ${CMD_ECHO} "# ERROR: "${DIRID1}" is not a directory or does not exist" return 4 fi if (( GENARYS == FALSE )) && (( GENCMDS == FALSE )) then GENARYS="${TRUE}" fi if (( SHWFILS == FALSE )) && (( SHWDIRS == FALSE )) then ${CMD_ECHO} "# ERROR: Do not specify both -d and -f, you must specify one or the other, or neither." return 2 fi trap "-" EXIT ################################################################ DCNT="0" FCNT="0" SCNT="0" DIRIDX="${DIRID1##*/}" (( ${#DIRIDX} > 8 )) && DIRIDX="${DIRIDX:0:8}"
  • 5. (( VERBOSE == TRUE )) && ${CMD_ECHO} "${SHEBANG:-#!/usr/bin/ksh93}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "################################################################" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Program Name..........: ${0}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Version...............: ${VERSION}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Script Execution Mode.: ${SHCODE}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Copyright Info........: Copyright 2007- 2015 by Dana French, All Rights Reserved" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Local hostname........: ${MACHNAME}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Top Level Directory...: ${DIRID1}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "# Variable index name...: ${DIRIDX}" (( VERBOSE == TRUE )) && (( SHWFILS == TRUE )) && ${CMD_ECHO} "# Show Files............: TRUE" (( VERBOSE == TRUE )) && (( SHWFILS == FALSE )) && ${CMD_ECHO} "# Show Files............: FALSE" (( VERBOSE == TRUE )) && (( SHWDIRS == TRUE )) && ${CMD_ECHO} "# Show Directories......: TRUE" (( VERBOSE == TRUE )) && (( SHWDIRS == FALSE )) && ${CMD_ECHO} "# Show Directories......: FALSE" (( VERBOSE == TRUE )) && (( GENCMDS == TRUE )) && ${CMD_ECHO} "# Generate Commands.....: TRUE" (( VERBOSE == TRUE )) && (( GENCMDS == FALSE )) && ${CMD_ECHO} "# Generate Commands.....: FALSE" (( VERBOSE == TRUE )) && (( GENARYS == TRUE )) && ${CMD_ECHO} "# Generate Arrays.......: TRUE" (( VERBOSE == TRUE )) && (( GENARYS == FALSE )) && ${CMD_ECHO} "# Generate Arrays.......: FALSE" (( VERBOSE == TRUE )) && (( GENSLNK == TRUE )) && ${CMD_ECHO} "# Generate Sym Link CMDS: TRUE" (( VERBOSE == TRUE )) && (( GENSLNK == FALSE )) && ${CMD_ECHO} "# Generate Sym Link CMDS: FALSE" ${CMD_ECHO} "" ${CMD_ECHO} "ALT_ROOT="${ALT_ROOT}"" ################################################################ #### #### The first thing the "getfilestruct" script does is to execute a "find" #### command to retrieve all the directories under the top level directory #### specified on the command line when the script was run. The "find" #### command produces "ls -ld" style output for the purpose of extracting and #### processing the attributes associated with each directory. #### ################################################################ (( SHWFILS == FALSE )) && (( SHWDIRS == TRUE )) && CMD='find "${DIRID1%/}" -type d -exec ls -ld {} ;' (( SHWFILS == TRUE )) && (( SHWDIRS == FALSE )) && CMD='find "${DIRID1%/}" ! -type d -exec ls -ld {} ;' (( SHWFILS == TRUE )) && (( SHWDIRS == TRUE )) && CMD='find "${DIRID1%/}" -exec ls -ld {} ;' (( SHWFILS == FALSE )) && (( SHWDIRS == FALSE )) && return 3 eval ${CMD} | while read -r -- RAWPERMS RAWLINKS RAWOWNER RAWGROUP RAWSIZE RAWDATE1 RAWDATE2 RAWDATE3 RAWFNAME do ################################################################ ####
  • 6. #### If the file is a symbolic link, generate the command to recreate the #### symbolic link and continue with the next file. #### ################################################################ if [[ "_${RAWPERMS}" == _l* ]] then LNAME="${RAWFNAME##* -> }" SNAME="${RAWFNAME% -> *}" [[ "_${LNAME}" != _/* ]] && LNAME="${SNAME%/*}/${LNAME}" if (( GENARYS == TRUE )) then ${CMD_ECHO} "n#### symbolic link "${RAWFNAME}"" ${CMD_ECHO} "SYM_${DIRIDX}_SNAME[${SCNT}]="${ALT_ROOT}${SNAME}"" ${CMD_ECHO} "SYM_${DIRIDX}_FLINK[${SCNT}]="${ALT_ROOT}${LNAME}"" SCNT=$(( ${SCNT} + 1 )) fi if (( GENSLNK == TRUE )) then ${CMD_ECHO} "n#### Generate symbolic link "${RAWFNAME}"" ${CMD_ECHO} "ln -s "${LNAME}" "${SNAME}"" else ${CMD_ECHO} "n#### Skipping symbolic link "${RAWFNAME}"" ${CMD_ECHO} "# ln -s "${LNAME}" "${SNAME}"" fi continue fi ################################################################ #### #### The file owner and group are easily #### extracted from the "ls -ld" output, however the permissions require #### some processing. #### ################################################################ # extract the owner for the directory from the ls -l output DOWNER="${RAWOWNER}" # extract the group for the directory from the ls -l output DGROUP="${RAWGROUP}" # extract the permission settings for the directory from the ls -l output PERMS="${RAWPERMS:1:9}" # extract the name of the directory from the ls -l output DIRNAME="${RAWFNAME}" [[ "_${DIRNAME}" == *lost+found ]] && continue ################################################################ #### #### The permission settings are contained within the first 10 characters #### of the "ls -ld" output and are processed in 3 steps. The first character #### is the file type and is ignored, the next 3 characters are associated #### with the "user" or file owner permissions. The permissions are #### checked to see if the tacky bit or SUID bit is set. If so #### the appropriate permission setting is added to the permission string #### which will be used when directory permissions are set. #### ################################################################ # extract the user permission settings for the directory from the ls -ld output
  • 7. UPERMS="${PERMS:0:3}" # remove the dashes "-" from the user permissions UPERMS="${UPERMS//-/}" # Convert lowercase "s" to "xs" in the user permissions UPERMS="${UPERMS//s/xs}" # Convert uppercase "S" to "s" in the user permissions UPERMS="${UPERMS//S/s}" # Convert lowercase "t" to "xt" in the user permissions UPERMS="${UPERMS//t/xt}" # Convert uppercase "T" to "t" in the user permissions UPERMS="${UPERMS//T/t}" ################################################################ #### #### The next set of 3 characters are associated with the "group" #### category of permissions. The permissions are checked to see #### if the tacky bit or SUID bit is set. If so the appropriate #### permission setting is added to the permission string which will #### be used when the directory permissions are set. #### ################################################################ # extract the group permission settings for the directory from the ls -ld output GPERMS="${PERMS:3:3}" # remove the dashes "-" from the group permissions GPERMS="${GPERMS//-/}" # Convert lowercase "s" to "xs" in the group permissions GPERMS="${GPERMS//s/xs}" # Convert uppercase "S" to "s" in the group permissions GPERMS="${GPERMS//S/s}" # Convert lowercase "t" to "xt" in the group permissions GPERMS="${GPERMS//t/xt}" # Convert uppercase "T" to "t" in the group permissions GPERMS="${GPERMS//T/t}" ################################################################ #### #### The last set of 3 characters are associated with the "other" #### category of permissions. Again, the permissions are checked to see #### if the tacky bit or SUID bit is set. If so the appropriate permission #### setting is added to the permission string which will be used when the #### directory permissions are set. #### ################################################################ # extract the other permission settings for the directory from the ls -ld output OPERMS="${PERMS:6:3}" # remove the dashes "-" from the other permissions OPERMS="${OPERMS//-/}" # Convert lowercase "s" to "xs" in the other permissions OPERMS="${OPERMS//s/xs}" # Convert uppercase "S" to "s" in the other permissions OPERMS="${OPERMS//S/s}" # Convert lowercase "t" to "xt" in the other permissions OPERMS="${OPERMS//t/xt}" # Convert uppercase "T" to "t" in the other permissions OPERMS="${OPERMS//T/t}" ################################################################ #### #### With the permission setting strings for each user category now known #### and extracted from the "ls -ld" output, a mnemonic "exact setting" #### string is constructed for use with the "chmod" command. ####
  • 8. ################################################################ # Build the mnemonic mode exact permission setting command DMODE="u=${UPERMS},g=${GPERMS},o=${OPERMS}" (( VERBOSE == TRUE )) && ${CMD_ECHO} "n#### n#### ${MACHNAME}:${DMODE}:$ {DOWNER}:${DGROUP}:${DIRNAME}" ################################################################ #### Depending upon the options specified when this script was run, #### either KornShell93/Bash compliant commands or Unix commands will #### be generated. #### #### The generated KornShell93/Bash Compliant commands can be used to #### define a variable array of values which contain the directory name #### and various attributes associated with each directory. #### #### The Unix commands generated consist of mkdir, chown, chgrp, and #### chmod, which can be used to create the directory and change its #### attributes to match those of the original directory. #### ################################################################ if [[ -d "${DIRNAME}" ]] then (( VERBOSE == TRUE )) && ${CMD_ECHO} "n${CMD_ECHO} "# Working on $ {DIRNAME}"" if (( GENARYS == TRUE )) then ${CMD_ECHO} "DIR_${DIRIDX}_DNAME[${DCNT}]="${ALT_ROOT}$ {DIRNAME}";" ${CMD_ECHO} "DIR_${DIRIDX}_OWNER[${DCNT}]="${DOWNER}";" ${CMD_ECHO} "DIR_${DIRIDX}_GROUP[${DCNT}]="${DGROUP}";" ${CMD_ECHO} "DIR_${DIRIDX}_CHMOD[${DCNT}]="${DMODE}";" fi if (( GENCMDS == TRUE )) then ${CMD_ECHO} "mkdir -p "${ALT_ROOT}${DIRNAME}";" ${CMD_ECHO} "chown ${DOWNER} "${ALT_ROOT}${DIRNAME}";" ${CMD_ECHO} "chgrp ${DGROUP} "${ALT_ROOT}${DIRNAME}";" ${CMD_ECHO} "chmod "${DMODE}" "${ALT_ROOT}${DIRNAME}";" fi DCNT=$(( ${DCNT} + 1 )) else if (( GENARYS == TRUE )) then ${CMD_ECHO} "FIL_${DIRIDX}_FNAME[${FCNT}]="${ALT_ROOT}$ {DIRNAME}";" ${CMD_ECHO} "FIL_${DIRIDX}_OWNER[${FCNT}]="${DOWNER}";" ${CMD_ECHO} "FIL_${DIRIDX}_GROUP[${FCNT}]="${DGROUP}";" ${CMD_ECHO} "FIL_${DIRIDX}_CHMOD[${FCNT}]="${DMODE}";" fi if (( GENCMDS == TRUE )) then ${CMD_ECHO} "chown ${DOWNER} "${ALT_ROOT}${DIRNAME}";" ${CMD_ECHO} "chgrp ${DGROUP} "${ALT_ROOT}${DIRNAME}";" ${CMD_ECHO} "chmod "${DMODE}" "${ALT_ROOT}${DIRNAME}";"
  • 9. fi FCNT=$(( ${FCNT} + 1 )) fi done return 0 } ################################################################ ################################################################ ################################################################ #### #### Main Body of Script Begins Here #### ################################################################ TRUE="1" FALSE="0" #### #### Extract the "shebang" line from the beginning of the script read SHEBANG < "${0}" export SHEBANG #### #### Test the "shebang" line to determine what shell interpreter is specified SHCODE="unknown" [[ "_${SHEBANG}" == _*/ksh* ]] && SHCODE="korn" [[ "_${SHEBANG}" == _*/bash* ]] && SHCODE="bash" [[ "_${SHEBANG}" == _*/zsh* ]] && SHCODE="zshell" export SHCODE #### #### Modify the commands and script according to the shell intpreter GBL_ECHO="echo -e" [[ "_${SHCODE}" == "_korn" ]] && GBL_ECHO="print --" [[ "_${SHCODE}" == "_zshell" ]] && GBL_ECHO="print --" && emulate ksh93 [[ "_${SHCODE}" == "_bash" ]] && shopt -s extglob # Turn on extended globbing #### #### Call the script function to begin processing getfilestruct_zbksh "${@}" exit ${?}
  • 10. fi FCNT=$(( ${FCNT} + 1 )) fi done return 0 } ################################################################ ################################################################ ################################################################ #### #### Main Body of Script Begins Here #### ################################################################ TRUE="1" FALSE="0" #### #### Extract the "shebang" line from the beginning of the script read SHEBANG < "${0}" export SHEBANG #### #### Test the "shebang" line to determine what shell interpreter is specified SHCODE="unknown" [[ "_${SHEBANG}" == _*/ksh* ]] && SHCODE="korn" [[ "_${SHEBANG}" == _*/bash* ]] && SHCODE="bash" [[ "_${SHEBANG}" == _*/zsh* ]] && SHCODE="zshell" export SHCODE #### #### Modify the commands and script according to the shell intpreter GBL_ECHO="echo -e" [[ "_${SHCODE}" == "_korn" ]] && GBL_ECHO="print --" [[ "_${SHCODE}" == "_zshell" ]] && GBL_ECHO="print --" && emulate ksh93 [[ "_${SHCODE}" == "_bash" ]] && shopt -s extglob # Turn on extended globbing #### #### Call the script function to begin processing getfilestruct_zbksh "${@}" exit ${?}