5

watch command doesn't work for alias commands.

Without alias:

➜  scrcpy git:(master) git -P branch
* master
➜  scrcpy git:(master) watch git branch

enter image description here

With alias

➜  scrcpy git:(master) which gb
gb: aliased to git branch
➜  scrcpy git:(master) watch gb

enter image description here

Pablo Bianchi
  • 17,371

1 Answers1

8

You will need to alias watch as well for this to work. It needs space around the command, i.e. alias watch='watch ' and after the space it is expecting the next part to be an alias as well.

So, we will create an alias with the -n in it as well. Since you are doing every 2 seconds create a new alias to watch every 2 seconds.

alias watch-2='watch -n 2 '

Then you would just run it as

watch-2 gb

Hope this helps!

Terrance
  • 43,712