sdbsh

NAME

sdbsh - execute shell command for each scn file entried in sdb

SYNOPSIS

sdbsh [ -pipe | - | -nopipe ] [ -do {good, bad} ] [ -cmd shell_command ] [ -var_string scn_string ]

DESCRIPTION

Execute the assigned shell command for each scn file which is entried in the sdb flow.

This command is useful in the following cases;

  1. You want to move all scn files which are entried in the sdb with the good flag.
  2. You want to check the file size for all scn files which are entried in the sdb with the good flag.
  3. You want to remove all scn files which are entried in the sdb with the bad flag.

    These function can be done by the following way;

    sdbload abc | sdbsh -cmd 'mv $scn backup'
    sdbload abc | sdbsh -cmd 'ls -l $scn'
    sdbload abc | sdbsh -do bad -cmd 'rm $scn'
    

    FILTER TYPE

    .sdb | sdbsh ( | .sdb )

    OPTIONS

    -pipe | - | -nopipe
    The keywords -pipe or - gives the .sdb flow for the following processes. The keyword -nopipe gives nothing for the following process.
    -do good | bad
    The shell command is done only for scn with the good/bad flag.
    -cmd shell_command
    Shell command you want to do. The strings are interpreted by the shell just before the actual action, although your inline command itself is interpreted by your shell before then. You should use the escape charater and/or quotation characters. See UNIX/Linux shell command instruction in detail.

    In the shell command stript you can use a string for replacement by scn filename. (The default string is $scn). The replacement string can be written only one in the shell_command. If no replacement string in the shell_command, it is assumed to be attached at the end of the shell_command.

    Only if the shell_command is the last option parameter, you can reduce key touching for "-cmd"

    -var_string scn_string
    The replacement string can be changed by using this option.

    DEFAULTS

    -nopipe -do good -var_string \$scn -prm sdbsh.prm

    BUGS

    SEE ALSO

    sdbload, sdbselect, .sdb

    HISTORY

    ver.3.00
    2003/1/5 T.Handa

    MANUAL VERSION

    2003/1/5 T.Handa
    return to the index