Questions tagged [watch]

Watch refers to observing the status of variables, files or directories for some or all possible actions such as additions, deletions or modifications.

Watch refers to observing the status of variables, files or directories for some or all possible actions such as additions, deletions or modifications.

1673 questions
430
votes
14 answers

OS X Bash, 'watch' command

I'm looking for the best way to duplicate the Linux 'watch' command on Mac OS X. I'd like to run a command every few seconds to pattern match on the contents of an output file using 'tail' and 'sed'. What's my best option on a Mac, and can it be…
joseph.hainline
  • 24,829
  • 18
  • 53
  • 70
424
votes
21 answers

AngularJS : How to watch service variables?

I have a service, say: factory('aService', ['$rootScope', '$resource', function ($rootScope, $resource) { var service = { foo: [] }; return service; }]); And I would like to use foo to control a list that is rendered in HTML:
berto
  • 8,215
  • 4
  • 25
  • 21
410
votes
28 answers

How do I watch a file for changes?

I have a log file being written by another process which I want to watch for changes. Each time a change occurs I'd like to read the new data in to do some processing on it. What's the best way to do this? I was hoping there'd be some sort of hook…
Jon Cage
  • 36,366
  • 38
  • 137
  • 215
352
votes
16 answers

Is there a command like "watch" or "inotifywait" on the Mac?

I want to watch a folder on my Mac and then execute a bash script, passing it the name of whatever file/folder was just moved into or created in the watched directory.
Mint
  • 14,388
  • 30
  • 76
  • 108
326
votes
10 answers

How to deep watch an array in angularjs?

There is an array of objects in my scope, I want to watch all the values of each object. This is my code: function TodoCtrl($scope) { $scope.columns = [ { field:'title', displayName: 'TITLE'}, { field: 'content', displayName: 'CONTENT'…
Freewind
  • 193,756
  • 157
  • 432
  • 708
287
votes
6 answers

AngularJS : Clear $watch

I have a watch function in my AngularJS application. $scope.$watch('quartzCrystal', function () { ... } However, after some condition (in my example, changing the page at my single-page application) I want to stop that watch (as like clearing…
kamaci
  • 72,915
  • 69
  • 228
  • 366
225
votes
7 answers

What is the Angular equivalent to an AngularJS $watch?

In AngularJS you were able to specify watchers to observe changes in scope variables using the $watch function of the $scope. What is the equivalent of watching for variable changes (in, for example, component variables) in Angular?
Erwin
  • 3,298
  • 2
  • 15
  • 22
186
votes
8 answers

Colors with unix command "watch"?

Some commands that I use display colors, but when I use them with watch the colors disappears: watch -n 1 node file.js Is it possible to have the colors back on somehow?
never_had_a_name
  • 90,630
  • 105
  • 267
  • 383
111
votes
20 answers

Converting Milliseconds to Minutes and Seconds?

I have looked through previous questions, but none had the answer I was looking for. How do I convert milliseconds from a StopWatch method to Minutes and Seconds? I have: watch.start(); to start the stopwatch and watch.stop(); to stop the…
user2426902
88
votes
4 answers

Watching variables in SSIS during debug

I have a project in SSIS and I've added an Execute SQL Task which sends its result out to a variable. I wanted to confirm the value because I was worried that it would try to write it out as a resultset object rather than an actual integer (in this…
Tom H
  • 46,766
  • 14
  • 87
  • 128
88
votes
9 answers

how to watch changes in whole directory/folder containing many sass files

How could I trace changes in whole directory containing many sass files ? I'm using the following command to watch changes in sass file: sass --watch style.scss:style.css But how to watch changes in whole directory/folder containing many sass…
JA9
  • 1,708
  • 3
  • 14
  • 18
54
votes
9 answers

watch file size on linux

I want to watch the growing size of a single file, so i use this command: texai@maelstrom ~$ ls -lh club_prod.sql | awk '{print $5}' 116M Now I want to watch that result each 5 seconds so: texai@maelstrom ~$ watch -n 5 ls -lh club_prod.sql | awk…
texai
  • 3,696
  • 6
  • 31
  • 41
51
votes
3 answers

AngularJS $watch window resize inside directive

I have revealing module pattern which looks like this: 'use strict'; angular.module('app', []) .directive('myDirective', ['SomeDep', function (SomeDep) { var linker = function (scope, element, attr) { // some work }; …
Lightfooted
  • 799
  • 1
  • 6
  • 13
50
votes
3 answers

Break on a change of variable value

Similar to other questions here, like this one. Is there a way to break on the change of a variable value in any JavaScript debugger? (like IE Developer tools, Visual Studio, or Firebug)? I guess it's something like a "watch variable", but I want to…
user420667
  • 6,552
  • 15
  • 51
  • 83
47
votes
6 answers

AngularJs $watch on $location.search doesn't work when reloadOnSearch is false

My routeProvider for route has reloadOnSearch set to false : $routeProvider .when( "/film/list", { templateUrl: '/film/list.html', controller: FilmListController, reloadOnSearch: false …
MBozic
  • 1,132
  • 1
  • 10
  • 22
1
2 3
99 100