summary refs log tree commit diff homepage
path: root/2022/day07.awk
blob: 4143a8bf0f15884c8030141eb51149c8fe04f1db (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
function parent(dir) {
	p = match(dir, "/[^/]+$");
	return substr(dir, 1, p-1);
}
/\$ cd \// {
	cwd = "/";
	next;
}
/\$ cd \.\./ {
	cwd = parent(cwd);
	next;
}
/\$ cd/ {
	cwd = cwd "/" $3;
}
/^[0-9]+/ {
	for (dir = cwd; dir != ""; dir = parent(dir)) {
		dirs[dir] += $1;
	}
}
END {
	for (dir in dirs) {
		if (dirs[dir] > 100000) continue;
		sum += dirs[dir];
	}
	print sum;
}
href='/src/commit/.config/nvim/colors/subtle.vim?id=56eefa3a284429d3c3fceab0d3b05288ea0f9143&follow=1'>Color comments DarkBlue and LightBlueJune McEnroe 2016-07-27Color macros in yellowJune McEnroe 2016-07-26Colorscheme colors and schemesJune McEnroe 2016-07-26Add ''subtle'' colorschemeJune McEnroe I'm just trying this out. 2016-07-26Add htoprcJune McEnroe 2016-07-24Add may and refactor ssh configJune McEnroe 2016-07-18Disable cursorlineJune McEnroe 2016-07-18Use hard constrast gruvbox darkJune McEnroe 2016-07-15Remove vim configurationJune McEnroe 2016-07-15Add readline to README configurations listJune McEnroe 2016-07-15Add vendor script to READMEJune McEnroe 2016-07-15Pull latest pathogen and gruvboxJune McEnroe