Results 1 to 3 of 3
  1. #1
    Join Date
    Aug 2011
    Posts
    11

    Unanswered: Syntax error : Unterminated quoted string....

    Hi,

    I am using GNU bash ,version 4.2.8(1) - release (i686-pc-linux-gnu) ubuntu 11.04

    I am trying to create a tar file for a directory.
    suppose the name of the directory is fruits..
    mytar.sh
    #!/bin/sh
    case $0 in
    *listtar) TARGS="-tvf $1" ;;
    *maketar) TARGS="-cvf $1.tar $1" ;;
    esac
    tar $TARGS

    after this created two links

    $ ln -s mytar.sh listtar
    $ ln -s mytar.sh maketar

    now when i am doing :
    $ ./maketar fruits

    I am getting this error.

    ./mytar.sh : 4 : Syntax error : Unterminated quoted string....
    Last edited by jason_bourne; 08-26-11 at 05:43.

  2. #2
    Join Date
    Sep 2009
    Location
    Ontario
    Posts
    1,057
    Provided Answers: 1
    Why do you have "#!/bin/sh" as line one instead of "#!/bin/bash" ?

    Also "listtar) TARGS="-tvf $1";;
    should be "listtar) TARGS="-tvf $1.tar";; ...no?
    Last edited by kitaman; 08-26-11 at 11:58.

  3. #3
    Join Date
    Aug 2011
    Posts
    11
    Quote Originally Posted by kitaman View Post
    Why do you have "#!/bin/sh" as line one instead of "#!/bin/bash" ?

    Also "listtar) TARGS="-tvf $1";;
    should be "listtar) TARGS="-tvf $1.tar";; ...no?

    Thanx Kitaman....that resolved the issue

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •