Welcome to the JaguarPC Community
JaguarPC
Sales: (888) 338-5261
Support: (888)-551-3050
Results 1 to 3 of 3

This is a discussion on executing script file from Linux command prompt in the Open Discussion & Chit-chat forum
Let's say I have a .TXT file that issues various mysqldump commands. How can I run this from the Linux command prompt like a .BAT ...

  1. #1
    crazy davey flipdoubt's Avatar
    Join Date
    Aug 2002
    Location
    Plymouth, MI
    Posts
    547

    executing script file from Linux command prompt

    Let's say I have a .TXT file that issues various mysqldump commands. How can I run this from the Linux command prompt like a .BAT file?

    Thanks in advance.

  2. #2
    Community Leader jason's Avatar
    Join Date
    Sep 2001
    Location
    Rochester, NY
    Posts
    6,003
    Are those actual my sql commands (as you would type them at the command line with the 'mysql' command included), or are they just SQL statements? If they are only the SQL statements, "SELECT FROM" or "INSERT INTO" for example, then you can upload the file into phpMyAdmin. If it contains the mysql command as you would type them into the command line, you can use this command:

    bash textfile.txt

    or you can add

    #!/bin/bash

    as the first line of the file and then chmod it to 700 to make it executable. They just type

    ./textfile.txt

    and it will run as a script.

    --Jason
    Jason Pitoniak
    Interbrite Communications
    www.interbrite.com www.kodiakskorner.com

  3. #3
    crazy davey flipdoubt's Avatar
    Join Date
    Aug 2002
    Location
    Plymouth, MI
    Posts
    547
    Thanks. It's that bash thing that I have to remember.

Bookmarks

Posting Permissions

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