shell - > /dev/null 2>&1 still has output in stdout -
i try following:
#!/bin/bash var=$(< temp.temp) > /dev/null 2>&1 echo $var
i expected no outputs whether temp.temp exists or not. when tried these command, still has outputs. on this? thanks.
use this:
{ var=$(<temp.temp); } 2>/dev/null
Comments
Post a Comment