Debian Codegraph @

ex65.sh

raw symbols SCIP
1 #!/bin/bashscip-shell filesystem . . `/bin/bash`.
2
3 # delete.sh, a not-so-cunning file deletion utility.
4 # Usage: delete filename
5
6 E_BADARGS=85
7
8 if [scip-shell system . . `[`. -z "$1" ]
9 then
10 echoscip-shell system . . echo. "Usage: `basenamescip-shell system . . basename. $0` filename"
11 exit $E_BADARGS # No arg? Bail out.
12 else
13 file=$1 # Set filename.
14 fi
15
16
17 [scip-shell system . . `[`. ! -f "$file" ] && echoscip-shell system . . echo. "File \"$file\" not found. \
18 Cowardly refusing to delete a nonexistent file."
19 # AND LIST, to give error message if file not present.
20 # Note echo message continuing on to a second line after an escape.
21
22 [scip-shell system . . `[`. ! -f "$file" ] || (rmscip-shell system . . rm. -f $file; echoscip-shell system . . echo. "File \"$file\" deleted.")
23 # OR LIST, to delete file if present.
24
25 # Note logic inversion above.
26 # AND LIST executes on true, OR LIST on false.
27
28 exit $?