Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #!/bin/bash
- for I in $@ # FYI: $@ - the first argument !$# - the last argument $# - number of arguments
- do
- # TODO: Do something with arguments like..
- echo $I
- done
- # Example for handling unicode string arguments by storing them into array elements
- K=1 # IMPORTANT! This is our index for elements in array
- for I in $@
- do
- ARRAY[$K]=$I
- # TODO: Whatever you want
- echo ${ARRAY[$K]}
- K=$(( K + 1 )) # Next element in array
- done
- # To operate with file parsed as argument and read it line by line
- source $1
- while read line
- do
- # TODO: Something whatever should be done with this file
- done < $1
- exit 0
Add Comment
Please, Sign In to add comment