Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6622231
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T21:22:46+00:00 2026-05-25T21:22:46+00:00

I want to get the versionName from the AndroidManist.xml file with a shell command.

  • 0

I want to get the versionName from the AndroidManist.xml file with a shell command.
I’ve been trying to use grep and with:

 grep versionName ./AndroidManifest.xml

I’m getting this line:

android:versionName="1.0">

Is it possible to narrow it down to 1.0 somehow?

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-25T21:22:47+00:00Added an answer on May 25, 2026 at 9:22 pm

    Try this :

    perl -e 'while($line=<>) { if ($line=~ /versionName\s*=\s*"([^"]+)"/) { print "$1\n";}}' <AndroidManifest.xml
    

    You may want to put this into a file :

    Ex: VersionNum.pl

    #!/usr/bin/perl
    
    #get the filename from command line
    $file = shift or die;
    
    #open the file and read it into $lines var
    open(IN,$file) or die;
    $lines=join("",<IN>); 
    close(IN);
    
    #search the $line var for match and print it
    if ($lines =~ m/android:versionName\s*=\s*"([^"]+)"/mgs)  {
       print "$1\n";
    }
    

    Then simply chmod 755 VersionNumber.pl and use it with VersionNumber.pl AndroidManifest.xml

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to know how to parse the AndroidManifest.xml file in order to get
I want get the image from an xml file which is encoded using base64.
I want define schema in each xml file that I marshalling. And then get
I want get the encoding from a stream. 1st method - to use the
I have xml from I want get some data XDocument loaded = XDocument.Load(@c:\TERC.xml); var
I want to get the size of an http:/.../file before I download it. The
Hi i want to get image faster from website in iphone.. Now i get
I want get the most specific from the current url in visual basic .net.
Like in Title I want to get position from List<Vector2> positions = new List<Vector2>{/*here
I'm trying to use flex and bison to create a filter, because I want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.