File: touch

package info (click to toggle)
kernel-image-2.6.8-alpha 2.6.8-17sarge1
  • links: PTS
  • area: main
  • in suites: sarge
  • size: 188 kB
  • ctags: 16
  • sloc: sh: 88; makefile: 84
file content (18 lines) | stat: -rwxr-xr-x 271 bytes parent folder | download | duplicates (16)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
#!/bin/sh

set -e

if [ -z "${1##-*}" ] && [ "$1" != -- ]; then
	exec touch.orig "$@"
fi

trap 'rm -f $TMP' EXIT
TMP=$(tempfile)

# Create the files if they don't exist.
touch.orig -a "$@"

tar -P --remove-files -cf $TMP "$@"
tar xfP $TMP
rm -f $TMP
exec touch.orig "$@"