The shell script looks like this:
#!/bin/bash
while [ true ]; do
clear
date
who
sleep 5
done
If I run int, I get the following:
yuikus@DESKTOP-VTJ0OG4:~$ cd /mnt/d/lab_oc_1/lab_oc_2/
yuikus@DESKTOP-VTJ0OG4:/mnt/d/lab_oc_1/lab_oc_2/$ sh bag.sh
bag.sh: 7: Syntax error: "done" unexpected (expecting "do")
yuikus@DESKTOP-VTJ0OG4:/mnt/d/lab_oc_1/lab_oc_2/$ bash bag.sh
bag.sh: line 7: syntax error near unexpected token `done'
bag.sh: line 7: `done '
Why doesn't it work? I run with Ubuntu, from Windows.
[ true ]
is the same as[ false ]
, i.e. it checks that the string isn't empty.watch -n 5 who
watch -n 5 who
command should do what your script does