trick tip: sucker punch for forums/irc with rules

Talk about anything you feel like talking about. Pull up a soapbox and pontificate to your heart's content. May contain some adult humour or otherwise objectionable content (NSFW). No warez, pr0n or illegal stuff.

Re: trick tip: sucker punch for forums/irc with rules

Postby nodir » October 29th, 2018, 7:08 pm

golinux wrote:fsmithred definitely wins this round.

(golinux has no idea what it does though . . . )

definitely.
Over the years i asked quite some bash nerds, and even they didn't know.
(might be they didn't understand me, as i didn't ask clearly. It isn't easy to describe what i want, but the code example from fsmithred should make it clear).
nodir
 
Posts: 307
Joined: June 16th, 2015, 10:10 pm

Re: trick tip: sucker punch for forums/irc with rules

Postby fsmithred » October 29th, 2018, 7:10 pm

@nodir - actually, I do have an idea how long. I think we talked about this in bash study group, and I'm not going to mention the year so we don't have to be reminded how old we are.

@golinux - try those commands in order. Also try replacing the :3 with :2, :1 or :4, but you must run the first command each time before you use the one with the secret code in it. What it does is repeat the selected argument from the previous command so you don't have to type it all out in the current command. (Like the path in nodir's example)
fsmithred
 
Posts: 341
Joined: February 11th, 2011, 4:14 am

Re: trick tip: sucker punch for forums/irc with rules

Postby Head_on_a_Stick » October 29th, 2018, 10:26 pm

golinux wrote:fsmithred definitely wins this round.

+1

@fsmithred, well played sir! And thanks for the lovely tip :)
Show Off
User avatar
Head_on_a_Stick
 
Posts: 163
Joined: June 16th, 2015, 8:35 pm
Location: London baby!

Re: trick tip: sucker punch for forums/irc with rules

Postby nodir » October 30th, 2018, 7:54 am

mainly golinux.
Here is a good example i use quite bit these days.
I have to diff 2 files, so i can see that i don't replace one of them with a wrong other one:
Code: Select all
 diff recipe /media/dragora_chroot/home/user/notabug/Qi-Recipes/Sources/recipes/devel/fltk/recipe

The result tells me: only a few changes, so yes, the neverending path is the right recipe. I go for the replacement.
Code: Select all
 cp !$ .

The last argument/parameter !$ of the last command run in the bash shell will be copied.

With the solution of fsmithred, i don't need to worry about the first command anymore, so i can access the last parameter of the last command.
Code: Select all
diff  /media/dragora_chroot/home/user/notabug/Qi-Recipes/Sources/recipes/devel/fltk/recipe recipe
cp !!:1 .

It now uses the first argument :1 of the last command !!
(and so forth, the second, the third ...).

-
To make it short: It really can be helpful.
Not often, but now and then.

---
---
On another note: i use that neverending path all the time I should figure out a way to create a shortcut for it ( /media/dragora_chroot/home/user/notabug/Qi-Recipes/Sources). Probably a variable or such. Never had that problem that often, these days i got it 20 times each day ...
i seem to remember i have heard other shells are better with that, btw.
nodir
 
Posts: 307
Joined: June 16th, 2015, 10:10 pm

Re: trick tip: sucker punch for forums/irc with rules

Postby fsmithred » October 30th, 2018, 11:52 am

I know you know this. Maybe you were away from computing for too long.
shortcut:
Code: Select all
ln -s /media/dragora_chroot/home/user/notabug/Qi-Recipes/Sources Sources
fsmithred
 
Posts: 341
Joined: February 11th, 2011, 4:14 am

Re: trick tip: sucker punch for forums/irc with rules

Postby nodir » October 30th, 2018, 3:25 pm

I see. Seems like a good solution. Will try.

Thing is: in those 12 years or such i never really had the need to do a softlink. No clue why, but it was never needed.

I also am busy trying to get my head into qi and the compiling process, to do so i also have to get my head into some cli tools like awk and find ( for convenience), move with bash faster, re-learn a bit about vim-usage, and git, and perhaps even more.
So i saw that the type-full-path approach sucks, history expansion didn't make it much better, Still i left that as a constant until now (to avoid more confusion).
confusion: happened more than once that i ran "vi push" or "git filename" or such ... too funny.

Not trying to explain me here. I know a few things, i don't know other things, some of them are being quite basic.

-
Long story short: thanks for the idea. Will move it back and forth in my head, then probably give it a try.
nodir
 
Posts: 307
Joined: June 16th, 2015, 10:10 pm

Re: trick tip: sucker punch for forums/irc with rules

Postby lester] » December 26th, 2018, 10:17 am

apt-get discO
haha

apt getmetothegreek
hehe

apt search wtf mo fo
hoho
python3-wtf-peewee/unstable 3.0.0+dfsg-1 all
WTForms integration for peewee models (Python 3)
User avatar
lester]
 
Posts: 211
Joined: January 28th, 2012, 8:13 am
Location: hienlien

Previous

Return to Nonsense

Who is online

Users browsing this forum: No registered users and 1 guest

cron

x