File: cli

package info (click to toggle)
python-xattr 0.9.6-1
  • links: PTS, VCS
  • area: main
  • in suites: bullseye, buster, sid
  • size: 208 kB
  • sloc: python: 693; ansic: 489; sh: 32; makefile: 15
file content (26 lines) | stat: -rwxr-xr-x 325 bytes parent folder | download
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
#!/bin/sh

set -e

cd "$ADTTMP"

FILE="file"
NAME="user.n"
VALUE="hi"

touch "$FILE"
echo -n "Save: "
xattr -w "$NAME" "$VALUE" "$FILE"
echo "OK"

echo -n "Read: "
RET=$(xattr -p "$NAME" "$FILE")
echo "OK"

echo -n "Compare: "
if [ "$RET" = "$VALUE" ] ; then
    echo "OK"
else
    echo "ERROR: $RET != $VALUE"
    exit 1
fi