docs: Make the lines in the code examples shorter

We should typically avoid scrolling even at max-width.

An exception here is the output of `functions` - this prints one very
long line, but it's really not important what's in there specifically,
it's just to illustrate the kind of output you'd get.
This commit is contained in:
Fabian Homborg
2021-01-26 09:26:17 +01:00
parent d5ce648e10
commit cbc9de3663
2 changed files with 30 additions and 17 deletions

View File

@@ -459,13 +459,13 @@ Here, ``make`` is only executed if ``./configure`` succeeds (returns 0), and ``s
fish also supports :ref:`and <cmd-and>`, :ref:`or <cmd-or>`, and :ref:`not <cmd-not>`. The first two are job modifiers and have lower precedence. Example usage::
> cp file1.txt file1_bak.txt && cp file2.txt file2_bak.txt ; and echo "Backup successful"; or echo "Backup failed"
> cp file1 file1_bak && cp file2 file2_bak; and echo "Backup successful"; or echo "Backup failed"
Backup failed
As mentioned in :ref:`the section on the semicolon <tut-semicolon>`, this can also be written in multiple lines, like so::
cp file1.txt file1_bak.txt && cp file2.txt file2_bak.txt
cp file1 file1_bak && cp file2 file2_bak
and echo "Backup successful"
or echo "Backup failed"
@@ -507,7 +507,9 @@ To compare strings or numbers or check file properties (whether a file exists or
# or
if test -e /etc/hosts # is true if the path /etc/hosts exists - it could be a file or directory or symlink (or possibly something else).
# This test is true if the path /etc/hosts exists
# - it could be a file or directory or symlink (or possibly something else).
if test -e /etc/hosts
echo We most likely have a hosts file
else
echo We do not have a hosts file