Bash script to display compatible Windows-talk based commands

Problem: Client X is a Windows user who wants to run pre-packaged bash commands using mnemonic keywords or “tag hints” when she enters her RedHat block through a shell.

Example: Client X logs into the host using ssh and wants to perform some routine file operations. She wants to be able to print.

copy file

and return the list of pre-fab fill-in-the-blank bash commands to select from

cp <@source@> <@dest@>               ### simple copy
cp -R <@startdir@>  <@destdir@>      ### recursive copy

Then she wants to be able to select one of these elements, fill in the blank and just press Enter to run the command.

Client X wants to specify in advance which commands she can use (in Windows-speak), and then hire a developer to translate them into bash commands, and then put them together in a script that allows her to talk to windows - talk to bash and return list of teams.

NOTE. Client X does not like apropos because it involves familiarity with the terms used in bash, as opposed to window calls. For example:

 apropos shortcut

doesn’t give her anything about creating symbolic links (although this is exactly what she wants), because she does not know what Windows calls are made on linux. Obviously, the concepts of Windows do not exceed 100%, so she will eventually have to find out, but she is busy with people and asks for this as a way to "facilitate" her understanding of Linux.

: - ? perl, python, ruby ​​ script, - ? - bash, ?

+5
1

, bash command-not-found. /etc/ bash.bashrc Ubuntu, :

...
# if the command-not-found package is installed, use it
if [ -x /usr/lib/command-not-found ]; then
        function command_not_found_handle {
                # check because c-n-f could've been removed in the meantime
                if [ -x /usr/lib/command-not-found ]; then
                   /usr/bin/python /usr/lib/command-not-found -- $1
                   return $?
                else
                   return 127
                fi
        }
fi
...

, , . Ubuntu Python, , , , , , / .

, , , , hashref , .

+5

All Articles