Results 1 to 4 of 4

Thread: tar file...

  1. #1
    Contributing Member
    Join Date
    Dec 2008
    Answers
    76

    tar file...

    Hi all,

    I need to write a Function to list the contents of tar file in bash..
    In this case, my input file is tar file..
    I know "tar -tvf inputtar.file " which results in showing the contents of input tar file.
    I need to define this as a function in bash,how?

    Thanks..


  2. #2
    Contributing Member
    Join Date
    Dec 2008
    Answers
    76

    Re: tar file...

    I findout myself..

    This will work...
    tartv() {
    tar -tvf ${1}
    }

    or
    tartv() {
    echo Enter the input file
    read INPUT
    tar -tvf $INPUT
    }


  3. #3
    Contributing Member
    Join Date
    Dec 2008
    Answers
    76

    Re: tar file...

    [QUOTE=ecearund;40368]I findout myself..

    This will work...
    tartv() {
    tar -tvf ${1}
    }

    or
    tartv() {
    echo Enter the input file
    read INPUT
    tar -tvf $INPUT
    }

    If anyone know about new way of doing it means..Keep Posted...


  4. #4
    Junior Member
    Join Date
    Apr 2009
    Answers
    3

    Re: tar file...

    use it :

    #tar -xvjf fileName

    if any problem then read man pages:
    #man tar


  5.  Sponsored Ads
    Ad


     

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
About us
Applying for a job can be a stressful and frustrating experience, especially for someone who has never done it before. Considering that you are competing for the position with a at least a dozen other applicants, it is imperative that you thoroughly prepare for the job interview, in order to stand a good chance of getting hired. That's where GeekInterview can help.
Interact