Bash isn't really all that funny when comparing strings.
:~> test="test"[email protected]
:~> if [ $test == test ]; then echo $test; fi
This will work, but! This is not usable when a whitespace character is introduced into the script, making it best practice to quote your strings.
One of the errors I've seen so far in his scripts this
if($USER == "kira")
This won't work because bash will ($USER == "kira") give you an "unary operator expected"-error. The correct syntax as described above is using [ and ] (with spaces between next "option" and them).
Second thing is that $USER >> file.txt won't work either, you're not making any output by doing that way unless you $USER variable contains a command which will create output.
Correct syntax here would be "echo $USER >> file.txt".
Third thing setting up a cronjob for this is not gonna help your form. Cronjobs will run as your user even thou you're not logged in.
Try adding something like this:
while [ true ]; do
<check commands goes here>
Execute this with the ampersand and it'll run every 5 minutes