Re: tiny quick newbie question

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jul 15, 2003 at 03:45:22PM +1000, Logan Linux wrote:
> 
> I am trying to create a database "automatically" with some sort of script.
> I have a file with a .sql extension and it contains the relevant "make the 
> database" info in it.
> How do I execute this?

You don't really, Sql files are scripts. They're meant to be read,
not executed.
Sql files are usually fed to the database server. If you use mysql,
this means (going from memory):

mysqladmin -u root -p create database
mysql -u root -p database < file.sql

> Im having trouble with "executions" since my move from w32.
> 
> If a file has extension .pl, it is a perl script and you can run
> perl -e script.pl
> right?

Not with the '-e' option (this means that the perl code is on the command line
but you can just type "perl script.pl" . I usually use the '-w' option to
activate warnings but that's just me.

You can also make the file executable "chmod +x script.pl" and make the first
line of your script "#!/usr/bin/perl", you can just type "./script.pl" .

> I still have to use
> sh script.sh to run an .sh file. I thought it was possible to just type the 
> name of the file if it was a .sh file
> ????

Yup, just add "#!/bin/sh" at the top of your script (it's called a she-bang, BTW),
make it executable and you should be good to go.

Emmanuel


-- 
Shrike-list mailing list
Shrike-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/shrike-list

[Index of Archives]     [Fedora Users]     [Centos Users]     [Kernel Development]     [Red Hat Install]     [Red Hat Watch]     [Red Hat Development]     [Red Hat Phoebe Beta]     [Yosemite Forum]     [Fedora Discussion]     [Gimp]     [Stuff]     [Yosemite News]

  Powered by Linux