|
|
@ -36,8 +36,8 @@ neatly indented, and the purpose of the snippet seems clear.
|
|
|
|
2. How will the ``if`` statement behave if there is a problem with the machine,
|
|
|
|
2. How will the ``if`` statement behave if there is a problem with the machine,
|
|
|
|
and, say, the ``/bin/grep`` binary is absent?
|
|
|
|
and, say, the ``/bin/grep`` binary is absent?
|
|
|
|
3. Ignoring quoting, are there any other syntax problems?
|
|
|
|
3. Ignoring quoting, are there any other syntax problems?
|
|
|
|
4. If this snippet is pasted snippet from its original script into an
|
|
|
|
4. If this snippet is pasted from its original script into an interactive
|
|
|
|
interactive shell, will it behave the same as before?
|
|
|
|
shell, will it behave the same as before?
|
|
|
|
5. Can you think offhand of differences in how the arguments to ``sudo
|
|
|
|
5. Can you think offhand of differences in how the arguments to ``sudo
|
|
|
|
...`` and ``ssh fileserver ...`` are parsed?
|
|
|
|
...`` and ``ssh fileserver ...`` are parsed?
|
|
|
|
6. In which context will the ``*`` glob be expanded, if it is expanded at all?
|
|
|
|
6. In which context will the ``*`` glob be expanded, if it is expanded at all?
|
|
|
@ -107,13 +107,13 @@ each stage:
|
|
|
|
'
|
|
|
|
'
|
|
|
|
|
|
|
|
|
|
|
|
Even with Python handling the heavy lifting of quoting each shell layer, and
|
|
|
|
Even with Python handling the heavy lifting of quoting each shell layer, and
|
|
|
|
and even if we fixed the aforementioned minor disk-wiping issue, I am still not
|
|
|
|
even if the aforementioned minor disk-wiping issue was fixed, it is still not
|
|
|
|
100% confident that I know precisely the argument handling rules for all of
|
|
|
|
100% clear that argument handling rules for all of ``su``, ``sudo``, ``ssh``,
|
|
|
|
``su``, ``sudo``, ``ssh``, and ``bash``.
|
|
|
|
and ``bash`` are correctly respected.
|
|
|
|
|
|
|
|
|
|
|
|
Finally, if any of the login shells involved may not be set to ``bash``, we
|
|
|
|
Finally, if any login shell involved is not ``bash``, we must introduce
|
|
|
|
must introduce additional layers of quoting, in order to explicitly invoke
|
|
|
|
additional quoting in order to explicitly invoke ``bash`` at each stage,
|
|
|
|
``bash`` at each stage, causing an explosion in quoting:
|
|
|
|
causing an explosion in quoting:
|
|
|
|
|
|
|
|
|
|
|
|
.. code-block:: bash
|
|
|
|
.. code-block:: bash
|
|
|
|
|
|
|
|
|
|
|
|