LinuxQuestions.org
Visit Jeremy's Blog.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software
User Name
Password
Linux - Software This forum is for Software issues.
Having a problem installing a new program? Want to know which application is best for the job? Post your question in this forum.

Notices


Reply
  Search this Thread
Old 11-15-2017, 08:00 PM   #1
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092
Blog Entries: 1

Rep: Reputation: 90
what's the best means to make a tool known to sysadmins/developers


Hi!

I have created a rather tiny tool on python that plays a very simple role: Takes input from stdin (or from files) and, instead of printing one line after the other, keeps on writing over the same output line. A simple example:

Code:
$ echo start; tar zxvf ../eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz | tail -n 10; echo end
start
eclipse/icon.xpm
eclipse/dropins/
eclipse/.eclipseproduct
eclipse/epl-v10.html
eclipse/about_files/
eclipse/about_files/IJG_README
eclipse/about_files/mpl-v20.txt
eclipse/about_files/lgpl-v21.txt
eclipse/about_files/webkit-bsd.txt
eclipse/about_files/mpl-v11.txt
end
vs

Code:
$ echo start; tar zxvf ../eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz | jol; echo end
start
eclipse/about_files/mpl-v11.txt                                                                                                                                              
end
So, while the tar process was going on, you could see the name of each file being decompressed on the same line. When it finishes, you see the last line.

It supports reading from stdin or from files, has an option to prepend output with the filename.

Now the question is.... what would be the next step to try to make it "known" by script-writers and readily/easily accessible?

https://github.com/eantoranz/jol

Thanks in advance
 
Old 11-16-2017, 07:45 AM   #2
allend
LQ 5k Club
 
Registered: Oct 2003
Location: Melbourne
Distribution: Slackware-current
Posts: 5,359

Rep: Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971Reputation: 1971
Perhaps you could supply a use case where your tool is better than
Code:
echo start; tar zxvf ../eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz | tail -n 10 | tr '\n' '\r'; echo; echo end
 
Old 11-16-2017, 09:28 AM   #3
eantoranz
Senior Member
 
Registered: Apr 2003
Location: Costa Rica
Distribution: Kubuntu, Debian, Knoppix
Posts: 2,092

Original Poster
Blog Entries: 1

Rep: Reputation: 90
That's close to what jol does.... but output is kind of garbled:

Code:
$ echo start; tar zxvf ../eclipse-java-luna-SR2-linux-gtk-x86_64.tar.gz | tr '\n' '\r'; echo; echo end
start
eclipse/about_files/mpl-v11.txttxtase_4.0.201.v20150204-1700.jar-1212.jar23-0116.jar4j-LICENSE.txtjarclipse.epp.package.java/pom.propertiesactions/jvmargs.propertieseserties
end
Plus, jol can open many files in a single shot (like what cat does) and print their output and by using the -f option it can tell you which file it's printing at a time. Maybe this is something that is not necessary? I'll tell you why I started jol. I created a script that expands dep files that are inside a tgz file. Then I use apt to install them. When my script was running, I would write something like 'Expanding packages....'. Then I would call tar zxvf and so my output would get loss after hundreds of lines of tgz output. I'd like to be able to know what I was doing. tr would be very close to what I need, as I just showed. I could also drop the v option from tar but then I wouldn't know what package is being extracted or if it's even working. By using jol I can see the output of tgz while keeping the terminal more or less one the same spot so I can see what was written on it before calling tar.

Hope that's a better explanation of what it can do.

Last edited by eantoranz; 11-16-2017 at 09:30 AM.
 
  


Reply

Tags
cli, filter, python, tool


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
LXer: Demand for Certified SysAdmins and Developers Is On the Rise LXer Syndicated Linux News 0 11-02-2017 02:33 PM
LXer: Oracle v. Google: What it means for software developers LXer Syndicated Linux News 0 06-11-2016 01:30 AM
LXer: What Wayland Means for Developers LXer Syndicated Linux News 0 12-05-2012 08:00 PM
what does make man && make setup check while installing qmail means vitalstrike82 Linux - Software 3 05-26-2009 10:41 AM
Let's make a LARGE community of Linux developers and make something cool Nad0xFF Programming 4 04-07-2005 11:12 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software

All times are GMT -5. The time now is 12:19 PM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration