LinuxQuestions.org
Review your favorite Linux distribution.
Home Forums Tutorials Articles Register
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 02-27-2011, 01:49 PM   #1
laurentc1991
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Rep: Reputation: 0
Exclamation gphoto2 commandline client


Hello,

I'm making a script for making tethered shooting easier in linux.
With that I'm using gphoto2.

But i want to display the battery status:
in commandline it is:

gphoto2 --get-config batterylevel

as a result I get:


Label: Battery Level
Type: TEXT
Current: 100%

Now I only want to display the percentage, is this possible?

thanks
 
Old 02-27-2011, 01:51 PM   #2
corp769
LQ Guru
 
Registered: Apr 2005
Location: /dev/null
Posts: 5,818

Rep: Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007Reputation: 1007
Code:
gphoto2 --get-config batterylevel | grep Current | cut -c 9-13
Edit - You might need to mess with the cut values; I'm at work, and not using linux at the moment.

Cheers,

Josh

Last edited by corp769; 02-27-2011 at 01:53 PM. Reason: Forgot the most essential part.
 
Old 02-28-2011, 03:33 AM   #3
laurentc1991
LQ Newbie
 
Registered: Feb 2011
Posts: 8

Original Poster
Rep: Reputation: 0
Worked Perfectly

thanks!
 
  


Reply



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
commandline bittorrent client linuxmandrake Linux - Software 1 01-13-2006 11:02 PM
Pureftpd + xinetd: Writes pureftpd commandline to client when connecting bomix Linux - Software 2 03-29-2005 09:21 PM
Commandline client for Micrsoft Messenger Service? Yocal Linux - Software 2 08-20-2004 10:20 PM
gphoto2 php_rocks Linux - Software 0 08-30-2003 02:02 AM
commandline download client j-ray Linux - Software 6 10-28-2002 04:05 PM

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

All times are GMT -5. The time now is 06:23 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
Open Source Consulting | Domain Registration