If it's not on-topic, it's in here.
Post a reply

script generators

Mon Jul 25, 2016 5:31 am

creates a script in /usr/local/bin named yadless, which is a graphical version of less:

Code:
echo -e '#!/bin/bash\n#### license: creative commons cc0 1.0 (public domain)\n#### http://creativecommons.org/publicdomain/zero/1.0/\nyad --text-info --editable --wrap  --fontname=monospace --show-uri --maximized --listen' > /usr/local/bin/yadless ; chmod  +x /usr/local/bin/yadless


to use: find /usr/share | yadless

if you prefer the script to the one-liner that puts it in /usr/local/bin:

Code:
#!/bin/bash
#### license: creative commons cc0 1.0 (public domain)
#### http://creativecommons.org/publicdomain/zero/1.0/
yad --text-info --editable --wrap  --fontname=monospace --show-uri --maximized --listen

Re: script generators

Mon Jul 25, 2016 1:09 pm

Here's one that I used when I was learning perl. I don't recall if I wrote this or if nadir did.

Code:
#! /usr/bin/env bash
# create a file for a perl program

#perl_playground="$(pwd)"
perl_playground="/some/path/to/my-scripts"
editor="geany"

if [[ $# -ne 1 ]]; then
    echo "Give it a name."
    exit 1
fi

echo "#!/usr/bin/env perl
# $1

use strict;
use warnings;
#use diagnostics;
use 5.012_003;
use autodie;
" >> "$perl_playground/$1"

$editor "$perl_playground/$1" &
exit 0
Post a reply