Frequently Asked Questions

  1. What is CCFE?
  2. Is CCFE a clone of SMIT?
  3. Can CCFE be installed on a host without Perl and Curses module installed?
  4. How to compile CCFE to binary executable?
  5. "Curses function 'new_item' is not defined in your Curses library at /usr/bin/ccfe line NNNN."
  6. By default, in GNOME Terminal the F10 key opens the "File" menu: how to use it with CCFE?
  7. How to let users to make their own menus and forms and access them from global menu?
  8. How to show dynamic menu items in your preferred order?
  9. How to remap function keys from F1 to F12?
  10. How to use CCFE as simple application launcher?
  11. What is the fastest method to deploy a CCFE front-end to a command?
  12. Tips & tricks for form initialization:
  13. Tips & tricks for form actions:
  14. Tips & tricks for form fields:

Q: What is CCFE?
A: The Curses Command Front-End is a tool which aim to speed-up and reduce errors in generic Unix command invocation, but can be used for many other purposes.


Q: Is CCFE a clone of the IBM AIX's SMIT?
A: No.
SMIT is an application designed to perform AIX system management. It's a complex application and based on the AIX's Object Data Manager.
CCFE is a very simple tool (currently a single Perl script), and can be used for many purposes, but is only a dumb front-end. Plugins can add features ("intelligence") to CCFE.


Q: Can CCFE be installed on a host without Perl and Curses module installed?
A: Yes, please see the next answer.


Q: How to compile CCFE to binary executable?
A: You can use the PAR Packager from CPAN:
Install the PAR-Packer from CPAN or from your preferred distribution repository (for example, the Ubuntu package libpar-packer-perl), then after installed CCFE:

     cp /usr/bin/ccfe /tmp/ccfe.pl
     pp -o /tmp/ccfe /tmp/ccfe.pl
    
The /tmp/ccfe binary file can run in Linux boxes without Perl interpreter and Curses Perl module.


Q: Why CCFE does not run and returns the following error:

   Curses function 'new_item' is not defined in your Curses library at /usr/bin/ccfe line NNNN.
   
A: This happens using a Curses Perl module built without pads, menus and forms support. For RPM-based distributions like RedHat, Fedora and CentOS, it is suggested the installation of the perl-Curses RPM from EPEL repository. If you install Perl Curses module from CPAN, you have to build it with pads, menus and form support as explained in the INSTALL file included in module source tarball.


Q: By default, in GNOME Terminal the F10 key opens the "File" menu: how to use it with CCFE?
A: In GNOME Terminal, disable the setting "Enable the menu shortcut key" in menu "Edit" / "Keyboard shortcuts".


Q: How to let users to make their own menus and forms and access them from CCFE global menu?
A: You can create the file /usr/lib/ccfe/smit/ccfe.menu/private.item to add to main (global) menu the "User private menu" item:

    item {
      id     = PRIVATE
      descr  = User private menu
      action = menu:private
    }
    
Then, every user can create its own private menu in its home directory, for example
    /home/john/.ccfe/ccfe/private.menu
    /home/bill/.ccfe/ccfe/private.menu
    
Users without private menu will get a
   File not found while loading menu "private"
error by selecting "User private menu" item in CCFE main menu.


Q: How to show dynamic menu items in my preferred order?
A: By default, dynamic menu items are sorted by item filename, so items

    one.item
    two.item
    three.item
    four.item
    five.item
    six.item
    
appears in menu ordered as follow:
    five.item
    four.item
    one.item
    six.item
    three.item
    two.item
    
To force an arbitrary order, you can rename item filenames, for example:
    10-one.item
    20-two.item
    30-three.item
    40-four.item
    50-five.item
    60-six.item
    


Q: How to remap function keys from F1 to F12?
A: Example: Quit from CCFE by pressing F12 key:

  • in file /etc/ccfe/ccfe.conf (or $HOME/.ccfe/ccfe.conf) put
           key_f12 = exit
         
  • and in /usr/share/ccfe/msg/C/ccfe define its label:
           KEY_F12_LABEL = "Quit"
         


Q: How to use CCFE as simple application launcher?
A: By calling the application using exec action in menus or forms.


Q: What is the fastest and simplest way to deploy a CCFE front-end to a command?
A: By using the metacharacter "*" in form action: for example, in fping.form, the action is the simple call "fping %{*}".


Q: How to display a pop-up message entering in a form?
A: You must write the message to standard error in form initialization block, for example:

  init { command:
    echo "Welcome $(whoami)!" > /dev/stderr
  }
  


Q: In certain conditions, I don't want to post a form.
A: Form initialization block must have an exit status greather than zero, for example:

  init { command:
    [ "$(whoami)" != root ] && exit 1
    exit 0
  }
  
As explained in previous answer, if you want to display a pop-up message before exit, you can use something like this:
  init { command:
    [ "$(whoami)" != root ] && echo 'Only root can do this!' > /dev/stderr && exit 1
    exit 0
  }
  


Q: How to put a single quote (') inside a single quoted string?
A: You must use the syntax '\''; for example:

  action { run:
    echo 'Error resizing logical volume '%{LV_NAME}'.' > /dev/stderr
  }
  
is wrong! You must use the following syntax:
  action { run:
    echo 'Error resizing logical volume '\''%{LV_NAME}'\''.' > /dev/stderr
  }
  


Q: I want to use a boolean field in my form which returns the string "YES" or "NO" in the action, but a field of type BOOLEAN does not work: why?
A: The most frequent mistake is to define a field like this:

  ### WRONG!!!
  field {
    id       = SHOW_CHANGED_FIELDS
    label    = Changed fields uses different video attribute?
    type     = BOOLEAN
    default  = const:YES
  } 
  
which returns a null value because no "option" attribute was defined, so the correct definition is like the following:
   ### Correct!
   field {
     id       = SHOW_CHANGED_FIELDS
     label    = Changed fields uses different video attribute?
     type     = BOOLEAN
     option   = YES,NO
     default  = const:YES
   } 
  
or you can alternatively use a string field:
  ### Correct!
  field {
    id       = SHOW_CHANGED_FIELDS
    label    = Changed fields uses different video attribute?
    type     = STRING
    len      = 3
    list_cmd = const:single-val:"YES","NO"
    default  = const:YES
  } 
  
IBM and AIX are trademarks of International Business Machines Corporation in the United States, other countries, or both.