Results 1 to 2 of 2
  1. #1
    Join Date
    May 2004
    Posts
    86

    Unanswered: Script issue mysql & Linux

    Below is my test.sh and my referral.sql now i want the .txt file to be named
    the systemdate and the timestamp .txt

    ex 20051009235959.txt somthing like that


    test.sh
    #!/bin/bash
    /usr/bin/mysql -u root ehpadmin </usr/etc/referral.sql


    referral.sql
    SELECT * INTO OUTFILE '/tmp/referral.txt'
    FIELDS TERMINATED BY ';' LINES TERMINATED BY '\N' FROM Referral_Authorization

    my test.sh calls my referral.sql
    thanks for help

  2. #2
    Join Date
    Apr 2005
    Location
    Lier, Belgium
    Posts
    122
    Add e.g.

    Code:
    mv /tmp/referal.txt /tmp/`/bin/date +%Y-%m-%d-%H%M`.txt
    at the end of your shell script.

    --
    felix

Posting Permissions

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