Which is the righy way to put a variable inside a command in bash?
I'm trying with:
PORT=80
`nc -zv -w30 127.0.0.1 $PORT >> /dev/null`
but it doesn'work.
>>), just write (>). That should work. If it's not working, something else is wrong.
PORT=80
nc -zv -w30 127.0.0.1 $PORT > /dev/null