File: os.SunOS

package info (click to toggle)
guilt 0.36-2
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster
  • size: 1,272 kB
  • ctags: 201
  • sloc: sh: 3,062; makefile: 93; perl: 42
file content (57 lines) | stat: -rw-r--r-- 812 bytes parent folder | download | duplicates (6)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
# usage: touch_date <unix ts> <file>
touch_date()
{
	touch -d @$1 "$2"
}

# usage: last_modified <file>
last_modified()
{
	stat -c "%Y" "$1"
}

# usage: format_last_modified <file>
format_last_modified()
{
	# must strip nano-second part otherwise git gets very
	# confused, and makes up strange timestamps from the past
	# (chances are it decides to interpret it as a unix
	# timestamp).
	stat -c "%y" "$1" | sed -e '
s/^\([0-9]\{4\}\)-\([0-9]\{2\}\)-\([0-9]\{2\}\) \([0-9]\{2\}\):\([0-9]\{2\}\):\([0-9]\{2\}\)\.[0-9]* \(.*\)$/\1-\2-\3 \4:\5:\6 \7/'
}

# usage: head_n [count]
head_n()
{
	head -n "$1"
}

# usage: sha1 [file]
sha1()
{
	if [ $# = 1 ]
	then
		sha1sum "$1"
	else
		sha1sum
	fi
}

# usage: cp_a <src> <dst>
cp_a()
{
	cp -a "$1" "$2"
}

# usage: _tac
_tac()
{
	tac
}

_seq()
{
	seq "$@"
	return $?
}