File: exists.sh

package info (click to toggle)
cssc 1.4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm, bullseye, forky, sid, trixie
  • size: 11,368 kB
  • sloc: cpp: 39,446; ansic: 17,403; sh: 11,328; python: 3,923; makefile: 1,929; perl: 342; awk: 15; sed: 15
file content (36 lines) | stat: -rw-r--r-- 681 bytes parent folder | download | duplicates (4)
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
#! /bin/sh

# exists.sh:  What if the input file doesn't exist?

# Import common functions & definitions.
. ../common/test-common

g1=new1.txt
g2=new2.txt
s1=s.$g1
s2=s.$g2
p1=p.$g1
p2=p.$g2
all="$s1 $g1 $p1 $s2 $g2 $p2 xxx1 xxx2 old.$g1 old.$g2"

m=mfile
remove $all $m


echo "%M%" >$m || miscarry could not create $m.

rm -f $p1 || miscarry could not remove $p1
ln -s / $p1 || miscarry could not ln -s / $p1
docommand e1 "${vg_unget} -r1.2 $s1" 1 "IGNORE" "IGNORE" 
rm -f $p1


docommand e2 "${admin} -i $s1" 0 "" "" <$m
docommand e3 "${get} -e $s1" 0 IGNORE IGNORE
docommand e4 "${vg_unget} -r1.2 $s1" 0 "IGNORE" "IGNORE" 

###
### Cleanup and exit.
###
remove $all $m
success