DIGIT-ARC read-only archive · snapshot: July 23, 2026

help!! can someone please explain me this script

3 posts · originally from https://geek.digit.in/community/threads/help-can-someone-please-explain-me-this-script.118566/

iinfi
iinfi Original post #1
Jun 21, 2009 at 11:42 PM
i m no good in scripting.
the source is here
*www.idevelopment.info/data/Unix/Li...html#Configure iSCSI Initiator and New Volume

and the code is here
Code:
/etc/udev/scripts/iscsidev.sh

#!/bin/sh

# FILE: /etc/udev/scripts/iscsidev.sh

BUS=${1}
HOST=${BUS%%:*}

[ -e /sys/class/iscsi_host ] || exit 1

file="/sys/class/iscsi_host/host${HOST}/device/session*/iscsi_session*/targetname"

target_name=$(cat ${file})

# This is not an open-scsi drive
if [ -z "${target_name}" ]; then
   exit 1
fi

echo "${target_name##*.}"

for the time being i need ur help in understanding this.
spoon feeding apart .. plz direct me to a place where i can understand scripting. i know there are scores on the net. any good tutorial which you folks may v used.

thanks
ManishSinha
Jun 22, 2009 at 4:35 PM
Bash scripting
*tldp.org/LDP/abs/html/

I think tldp is enough for the start.
iinfi
iinfi #3
Jun 22, 2009 at 9:33 PM
thank you ....