On Thu, 19 Oct 2017 at 09:05:47 -0300
Sergio Belkin <[email protected]> wrote:
> I agree with removing fmt. Also, I think that {un}expand should be removed
> too.
>
> Through years I've never seen anyone using fmt, {un}expand, and pr in the
> wild.
Not that I do consider knowledge of it fundamental, but were you looking
for an active and happy fmt user, (fanfare trilling) "Here i Am!" :-)
Many of my more complex scripts have lines like these:
# Allow aliases to be expanded in the non-interactive shell
shopt -s expand_aliases
# It might be necessary removing the fmt parameter --goal=$(($COLUMNS - 1)),
# should the following error show up:
# fmt: unrecognized option '--goal=79'
# fmt from coreutils-8.13-3.5 does so.
# coreutils-8.23-4 (Ubuntu 15.0 and Debian 8.3) honour this parameter though.
alias format_out='fmt --uniform-spacing --tagged-paragraph --width=$COLUMNS'
Then, whenever I want to output a lot of text that I wished was formatted
according to the actual terminal width, I use the following:
cat << EOH | format_out
lots-lots-of-text-on-long-and-log-lines
EOH
I don't know an easier way to do the same without letting my scripts depend
on some particular, optional package to be installed.
expand and unexpand are of little use, I agree, but they also are so
stupidly simple, taking them out will save at most 30 seconds of course
time. In fact i seldom teach them, I just let people know they exist and
they are expected to be able to use them, like most classic, trivial
text-stream-filter commands. I just wished questions were focused on
their essentials, not on details like their swithes, like:
Good question:
A) What command can be used to do the same as cat -n?
1) tr
2) echo
3) nl
4) ln
Not so good question:
B) What command produces the same output as cat -n?
1) cat -e
2) nl -s A
3) nl -b a
4) echo -n
Alessandro
> rid out
> Please get them rid out.
> SB
>
>
> El 12 oct. 2017 4:10 a.m., "Martin Møller Skarbiniks Pedersen" <
> [email protected]> escribió:
>
> On 10 October 2017 at 22:10, Fabian Thorns <[email protected]> wrote:
> >
> > We might want to start commenting on exam 101 here.
>
> OK. Here is my list of suggestions for updating 101:
>
> 103.2 "Process text streams using filters":
> Drop fmt. Too many utilities in this topic and very few uses
> fmt.
> 103.3 Perform basic file management"; Add unxz, bunzip2 because gunzip is
> already there.
> Add bzcat, xzcat, zcat.
> 103.4 "Use streams, pipes and redirects": Add GNU parellel
> 103.5 "Create, monitor and kill processes" Add tmux. I also tell my
> students that tmux is much better than screen
> 104.1 "Create partitions and filesystems": Remove awareness of ReiserFS.
> 104.4 "Manage disk quotas": Drop this section.
> 105.3 "SQL data management". Rename to "SQL system administration" and
> focus on
> how to create sql-users, change/set password and grants for
> sql-users in postgres and mysql/mariadb. Maybe consider
> sqlite.
> 107.2 "Automate system administration tasks by scheduling jobs": Add
> systemd-timers. On newer installation crontab and
> at-jobs tools are not installed by default and
> systemd- timers are the way to do things now.
> 108.1 "Maintain system time": Add timedatectl
> 110.2 "Setup host security": Drop all about inetd.conf and /etc/inetd.conf
> but keep xinetd.conf
>
> Regards
> Martin M. S. Pedersen
> LPIC-instructor at SuperUsers Denmark
>
> _______________________________________________
> lpi-examdev mailing list
> [email protected]
> http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-examdev
--
Alessandro Selli http://alessandro.route-add.net
VOIP SIP: [email protected]
Chiavi PGP/GPG keys: B7FD89FD, 4A904FD9
_______________________________________________
lpi-examdev mailing list
[email protected]
http://list.lpi.org/cgi-bin/mailman/listinfo/lpi-examdev