Find the answer to your Linux question:
Results 1 to 3 of 3
Hey guys, So this past weekend I did a server migration to a new box. Im trying to write a simple script that asks what file you want to burn ...
  1. #1
    Linux User zacam87's Avatar
    Join Date
    Dec 2004
    Location
    Viriginia
    Posts
    284

    simple dvd script question

    Hey guys, So this past weekend I did a server migration to a new box. Im trying to write a simple script that asks what file you want to burn to a dvd, then burns it to disc. something similar to this:
    Code:
    #!/bin/bash
    echo -e "Please make sure there is a DVD in the drive and type in the location of the .avi file: "
    read file
    growisofs -use-the-force-luke=dao -dvd-compat -J -R -l -f -Z /dev/dvdwriter -speed=6 $file
    the problem is when you type in the location of the dvd file, I'd like to be able to use TAB to complete the path. Unfortunately this does not work. Does anyone know how to make it so you can use TAB to complete paths in scripts? thanks!
    I can imagine a perfect world, a world without hate, a world without war. Then I can imagine us attacking that world because they\'d never expect it.

  2. #2
    Just Joined! clickalot's Avatar
    Join Date
    Nov 2009
    Location
    Erlangen, Germany
    Posts
    37
    Hi,

    you could try this:
    Code:
    #!/bin/bash
    growisofs -use-the-force-luke=dao -dvd-compat -J -R -l -f -Z /dev/dvdwriter -speed=6 $1
    $1 is set by the first option of the script.

    if you name the previous script fry (and have a file called Somefle.avi) than you can use the TAB completion feature in the shell:
    Code:
    $ fry Som<TAB>
    gives
    Code:
    $ fry Somefile.avi

  3. #3
    Linux User zacam87's Avatar
    Join Date
    Dec 2004
    Location
    Viriginia
    Posts
    284
    ahh, I cant beleive I didnt think about that! Thanks alot I really appreciate it!
    I can imagine a perfect world, a world without hate, a world without war. Then I can imagine us attacking that world because they\'d never expect it.

Posting Permissions

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