FrontPage 

Fuego 1.1 wiki

Login or create account

function is on target in split format

NAME [edit section]

= NAME =
is_on_target

SYNOPSIS [edit section]

= SYNOPSIS =
 * is_on_target <item> <varname> [<path>[:<path2>...]]

DESCRIPTION [edit section]

= DESCRIPTION =
The function is_on_target scans for the given filesystem item (file or directory) on the target device, and if found puts the absolute path
of the item into the indicated variable.
The optional 3rd argument specifies a list of places to search for the item. It is a colon-separated list of directory names. If this argument is not specified, then the 'find' command is used on the target to try to locate the item, by name, from the root of the filesystem.
The optional 3rd argument specifies a list of places to search for
the item.  It is a colon-separated list of directory names.
If this argument is not specified, then the 'find' command is used
on the target to try to locate the item, by name, from the root of
the filesystem.

Note that if the target filesystem is large, this operation could take a long time.

''Note that if the target filesystem is large, this operation
could take a long time.''

EXAMPLES [edit section]

= EXAMPLES =
Here are some sample invocations:
{{{#!YellowBox
    is_on_target bc BC_PROGRAM /bin:/usr/bin:/usr/local/bin
    assert_define BC_PROGRAM
}}}

ENVIRONMENT and ARGUMENTS [edit section]

= ENVIRONMENT and ARGUMENTS =
 * $1 is the item to find in the remote filesystem
 * $2 is the name of the variable to set
 * $3 (optional) is a colon-separated path of directories to scan for this item in

RETURN [edit section]

= RETURN =
Returns non-zero on error.  If the item is found, the full path to
the item is returned as the value of the specified variable.

SOURCE [edit section]

= SOURCE =
Located in ''scripts/functions.sh''

SEE ALSO [edit section]

test_pre_check, is_on_target_path
= SEE ALSO =
 * [[function_test_pre_check|test_pre_check]], [[function_is_on_target_path|is_on_target_path]]
TBWiki engine 1.8.3 by Tim Bird