Команды SFK


    1        2        3        4        5        6        7        8        9        10    

Раздел 7. Scripting - Скрипты
alias | batch | call | cd | clock | color | echo | for | getcwd | label | loop | mkcd | pause | require | setvar | sleep | stop | storetext | tee | time | tofile | toterm |

Help:   Рус   |   Eng        Refer:   Рус   |   Eng  

Команда: alias
sfk alias [-list|-del|-ren] [shortname] [=] [command]

   create, list, delete or rename command aliases. aliases are
   short command names selected by yourself to save typing effort.

   sfk alias shortname = command ...

      create an alias. this actually creates a small batch file
      in the directory where sfk itself is located.

      requirements:
      -  the sfk executable has been copied into some directory x.
      -  this directory x must be in your PATH.
      -  you must have write permission for directory x.
      -  directory x is NOT the current working directory ".".

      if any of these requirements is not met, the command will fail.
      for example, if sfk.exe is located just in your current
      working directory ".", copy sfk.exe into a different
      directory of the PATH, and then start aliasing.

   alternative bath file path by SFK_PATH

      you may also create a separate folder for your batch files
      which must be listed in the PATH environment variable.
      then set SFK_PATH=myfolder to let sfk write into that.

   options
      -verbose   tell in detail which batch folder is used

   see also
      sfk mkcd : create an alias remembering the current directory.

   web reference
      http://stahlworks.com/sfk-alias

   examples
      sfk alias list = "sfk list"
         creates the alias named "list". from now on, you can
         type "list" instead of "sfk list".

      sfk alias wherc = "sfk list -arc . .jar filter -+%1.class"
         creates alias "wherc", searching for class files in jars.
         after the alias exists, command "wherc Foo" executes the
         commands from above, listing all class names with "Foo".

      sfk alias tab2c "sfk fromclip +filt -spat -rep _\t_,_ +toclip"
         then type tab2c to replace tabs by commas within clipboard.

      sfk alias copytoday "sfk run \"copy $file c:\tmp\" . -today"
         copy all files changed today to c:\tmp. if double quotes "
         should be part of your command, they must be escaped as \"

      sfk alias wide MODE CON COLS=160
         extend the current shell window to a width of 160 columns.

      sfk alias ec "notepad c:\app\bin\%1.bat"
         provided that c:\app\bin is in your path, creates
         a command "ec" to instantly edit further commands.

      sfk alias xclip sfk fromclip +xex _%1_
         if clipboard contains text like foo bar hoo
         then xclip bar* shows only text starting from bar.

      PARAMETER LIMITATION: note that the created batch files
      may accept only a maximum of 9 parameters, called %1 to %9.
      Further parameters may be ignored, or cannot be addressed.

      USE SURROUNDING QUOTES whenever your command string contains
      special characters like % \ ! otherwise these chars may be
      removed (or misinterpreted) by the command shell.

   sfk alias -list
      list all existing aliases. this actually scans the directory
      where sfk is located for batch files containing aliases.

   sfk alias shortname
      list definition of an existing alias.

   sfk alias -del aliasname
      delete an alias (deletes the associated batchfile).

   sfk alias -ren oldname newname
      rename an alias (renames the associated batchfile).