File: remove-sibling.sh

package info (click to toggle)
bfs 4.1-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 5,484 kB
  • sloc: ansic: 21,302; sh: 3,227; makefile: 221
file content (10 lines) | stat: -rwxr-xr-x 137 bytes parent folder | download | duplicates (3)
1
2
3
4
5
6
7
8
9
10
#!/usr/bin/env bash

for file in "${1%/*}"/*; do
    if [ "$file" != "$1" ]; then
        rm "$file"
        exit $?
    fi
done

exit 1