NAME
search – search a list of files, set environment variable to first found

SYNOPSIS
var = `{search var file ... }

DESCRIPTION
If the file $var exists, search prints its name. Otherwise, it iterates over the list of files and prints the name of the first one that exists. If none exist, it prints `var? ' on /dev/cons and reads a file name from standard input until given one that exists.

EXAMPLES
Find our standalone root fossil file system.
fossil = `{search fossil /dev/fs/stand /dev/fs/fossil \
/dev/sd[~e–h]?/fossil}

SOURCE
/rc/bin/search
Copyright © 2025 Plan 9 Foundation