Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Intentionally Left Blank

15 views
Skip to first unread message

Luka Ćavara

unread,
May 11, 2013, 11:57:50 AM5/11/13
to
echo -e "\nPaste a list and press
Ctrl+d\n";l=$(</dev/stdin);echo;a="Edit command line";read -ep "$a
start: " -i "cp -a" c;read -ep "$a end: " -i "~/backup" p;echo -e
"\nSkip single step with Ctrl+u\n";for i in $l;do read -ep "> " -i "$c
$i $p" w; eval "$w";done

Above command will enable you to:

1. Paste a list in console screen
2. Write a command
3. Execute

The command will repeat, every time
with new argument read from the list

Syntax:
<command line start><argument from the list><command line end>

Hint:

Paste a column or list of data from anywhere. I.e. utilize the Block
Select Mode to drag, select and copy columns (In KDE Konsole with
Ctrl+Alt pressed, or only Ctrl pressed in GNOME Terminal respectively).

Example:

Paste a list and press Ctrl+d

174.120.202.2 174.120.3.34 174.120.3.34
174.122.127.2 174.122.127.2
50.87.85.178
50.97.99.135
65.254.224.23 66.96.128.64
74.53.117.226

Edit command line start: whois
Edit command line end: |grep abuse

Executing! Skip single step with Ctrl+u

> whois 174.120.202.2 |grep abuse
OrgAbuseEmail: ab...@theplanet.com
RAbuseEmail: ab...@theplanet.com
network:Tech-Contact;I:ab...@websitewelcome.com
network:Admin-Contact;I:ab...@websitewelcome.com
network:Abuse-Contact;I:ab...@softlayer.com
> whois 174.120.3.34 |grep abuse
OrgAbuseEmail: ab...@theplanet.com
RAbuseEmail: ab...@theplanet.com
network:Tech-Contact;I:ab...@websitewelcome.com
network:Admin-Contact;I:ab...@websitewelcome.com
network:Abuse-Contact;I:ab...@softlayer.com
> whois 174.122.127.2 |grep abuse
OrgAbuseEmail: ab...@theplanet.com
RAbuseEmail: ab...@theplanet.com
network:Tech-Contact;I:ab...@theplanet.com
network:Admin-Contact;I:ab...@theplanet.com
network:Abuse-Contact;I:ab...@softlayer.com
> whois 50.87.85.178 |grep abuse
OrgAbuseEmail: ab...@unifiedlayer.com
network:Abuse-Contact: ab...@unifiedlayer.com
> whois 50.97.99.135 |grep abuse
OrgAbuseEmail: ab...@softlayer.com
> whois 65.254.224.23 |grep abuse
> whois 66.96.128.64 |grep abuse
> whois 74.53.117.226 |grep abuse
OrgAbuseEmail: ab...@theplanet.com
RAbuseEmail: ab...@theplanet.com
network:Abuse-Contact;I:ab...@softlayer.com

--
ɹɥ˙ʇǝuʇɥ˙ƃz@ɐɹɐʌɐɔ˙ɐʞnן

Mladen Gogala

unread,
May 11, 2013, 1:11:31 PM5/11/13
to
On Sat, 11 May 2013 17:57:50 +0200, Luka Ćavara wrote:

> echo -e "\nPaste a list and press
> Ctrl+d\n";l=$(</dev/stdin);echo;a="Edit command line";read -ep "$a
> start: " -i "cp -a" c;read -ep "$a end: " -i "~/backup" p;echo -e
> "\nSkip single step with Ctrl+u\n";for i in $l;do read -ep "> " -i "$c
> $i $p" w; eval "$w";done
>
> Above command will enable you to:

Ti se danas ne osjecas dobro?

>
> 1. Paste a list in console screen 2. Write a command 3. Execute
>
> The command will repeat, every time with new argument read from the list

Ah, radi se o verziji "xargs"? Da, to mi djeluje prakticno, umjesto
"xargs" bih trebao samo natipkati gornju monstruoznu p*dariju i voila,
svi moji problemi su rijeseni.



--
Mladen Gogala
The Oracle Whisperer
http://mgogala.byethost5.com
0 new messages