script compatible with command line