FrontPage 

Fuego wiki

Login or create account

function is abs path in split format

NAME [edit section]

= NAME =
is_abs_path

SYNOPSIS [edit section]

= SYNOPSIS =
is_abs_path <path>

DESCRIPTION [edit section]

= DESCRIPTION =
Checks if the supplied path is absolute (starts with /) or relative.

EXAMPLES [edit section]

= EXAMPLES =
Here are some sample invocations:
{{{#!YellowBox
  is_abs_path /usr/share/foo (returns 0)
  is_abs_path foo (returns 1)
}}}
Usage within an if-else statement:
{{{#!YellowBox
  if is_abs_path $MYFILEPATH; then
    echo "absolute path"
  else
    echo "relative path"
  fi
}}}

ENVIRONMENT and ARGUMENTS [edit section]

= ENVIRONMENT and ARGUMENTS =
 * $1 is the path argument 

RETURN [edit section]

= RETURN =
Returns 0 if the path is absolute and 1 otherwise.

SOURCE [edit section]

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

SEE ALSO [edit section]

= SEE ALSO =
TBWiki engine 1.8.3 by Tim Bird