My problem is quite simple, this script of mine isn't working.
What I want is that if i run "./myScript 192.168.0.1" if should make VICTIM=192.168.0.1 and this works fine. But when I run "./myScript" without anything else it should use a default 127.0.0.1 instead.Code:if [ -n "$@" ] then VICTIM="$@" echo "if?" else VICTIM="127.0.0.1" echo "else?" fi
As far as I know $@ is empty, I've even echoed it to see that it is. But it still doesn't want to run else. What am I doing wrong?
Bookmarks