#!/bin/bash
NetName=$( iwgetid -r )
echo $NetName >> someFile.txt
When I run this in a cron job it only appends a blank line to someFile.txt, but when I run from the terminal directly it appends the network id. What is going on here?
#!/bin/bash
NetName=$( iwgetid -r )
echo $NetName >> someFile.txt
/etc/cron.*
folders?iwgetid
in the script or probably more convenient expand crons $PATH e.g by adding a line like this to the relevant crontab - PATH="/usr/bin:/bin:/usr/local/bin:/usr/sbin:/sbin:/usr/local/sbin"