Welcome
Welcome to refracta

You are currently viewing our boards as a guest, which gives you limited access to view most discussions and access our other features. By joining our free community, you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content, and access many other special features. In addition, registered members also see less advertisements. Registration is fast, simple, and absolutely free, so please, join our community today!

script generators

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

script generators

Postby figlfdev » Mon Jul 25, 2016 5:31 am

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

Code: Select all
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: Select all
#!/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
figlfdev
 
Posts: 109
Joined: Tue May 31, 2016 6:23 pm

Re: script generators

Postby fsmithred » 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: Select all
#! /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
User avatar
fsmithred
 
Posts: 1987
Joined: Wed Mar 09, 2011 9:13 pm


Return to General Nonsense

Who is online

Users browsing this forum: No registered users and 0 guests

suspicion-preferred