Bagi juragan pembaca yang belum atau ingin memahami lebih dalam tentang dunia internet agar memiliki skill/keterampilan bermain internet, di sini tempatnya
Home »
lainnya
» Shell Scripting Tutorial For Beginners Four - Snuff It Arguments To A Bash-Script
Shell Scripting Tutorial For Beginners Four - Snuff It Arguments To A Bash-Script
Posted by Hold
on January 26, 2017
#! /bin/bash# $* Returns a unmarried string (``$1, $2 ... $n'') # comprising all of the positional parameters# separated past times the internal plain separator graphic symbol #(defined past times the IFS surroundings variable).# $0 Refers to the refer of the script itselfecho $0 $1 $2 $3 ' > echo $1 $2 $3'# $@ Returns a sequence of strings # (``$1'', ``$2'', ... ``$n'')# wherein each positional parameter # remains variety from the others.args=("$@")echo ${args[0]} ${args[1]} ${args[2]} echo $@# $# Refers to the lay out of arguments # specified on a ascendence line.echo $#
output:
test@test$ ./hello.sh Mark Tom John ./hello.sh Mark Tom John > echo $1 $2 $3Mark Tom JohnMark Tom John3
0 comments:
Post a Comment