public inbox for cygwin@cygwin.com
 help / color / mirror / Atom feed
* Need help creating a script that is ran from a batch file.
@ 2012-08-19 19:55 Michael Steele
  2012-08-19 21:18 ` Paul Thompson
       [not found] ` <20120820212619.M16512@ds.net>
  0 siblings, 2 replies; 3+ messages in thread
From: Michael Steele @ 2012-08-19 19:55 UTC (permalink / raw)
  To: cygwin

I know very little about creating a script under cygwin. I have a particular 
tack that doesn't change and I'm running it manually. I'm thinking that since 
it doesn't change that it could be automated. As you can see below I'm 
compiling three programs and the last program is my executable.

The first time I setup the cygwin environment it doesn't need to 'make clean'. 
I'm not sure if it hurts to run 'make clean' if it doesn't need to. Maybe a 
check in place would be prudent if it shouldn't be running 'make clean if it 
doesn't need to?

Here are the commands I run from within cygwin:

Open the Cygwin terminal

cd /cygdrive/e/development/cygwin/mysql-5.5.25a/
make clean
perl cmake/configure.pl
make && make mysqlclient && make install

cd /cygdrive/e/development/cygwin/postgresql-9.1.4/
make clean
./configure
make && make install

cd /cygdrive/e/development/cygwin/barnyard2/
make clean
./autogen.sh
./configure --with-mysql --with-postgresql
make && make install

When it completesw the process I need it to create a folder and copy all the 
prudent files and folder. I'm not sure if the below are correct syntax.

mkdir /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/barnyard2/src/.libs/barnyard2.exe /cygdrive/e/cygwin/barn
/

cp /cygdrive/e/cygwin/barnyard2/etc/ /cygdrive/e/cygwin/barn/etc/

cp /cygdrive/e/cygwin/barnyard2/schemas/ /cygdrive/e/cygwin/barn/schemas/

cp /cygdrive/e/cygwin/barnyard2/etc/barnyard2.conf /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/bin/cyggcc_s-1.dll /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/bin/cygwin1.dll /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/bin/cygz.dll /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/usr/local/mysql/lib/cygmysqlclient-
18.dll /cygdrive/e/cygwin/barn/

cp /cygdrive/e/cygwin/usr/local/pgsql/lib/cygpq.dll /cygdrive/e/cygwin/barn/

then exit


--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Need help creating a script that is ran from a batch file.
  2012-08-19 19:55 Need help creating a script that is ran from a batch file Michael Steele
@ 2012-08-19 21:18 ` Paul Thompson
       [not found] ` <20120820212619.M16512@ds.net>
  1 sibling, 0 replies; 3+ messages in thread
From: Paul Thompson @ 2012-08-19 21:18 UTC (permalink / raw)
  To: cygwin

The cygwin and unix world is a "help yourself" world. You must do some
work. No one is here to do it for you.

What I did in your position was to look for a bash script, and copy
it. Then you modify it. When you get stuck, use google to look for
help. I have just written a number perl programs knowing nothing about
perl, just use google to search for help. There's a lot of stuff out
there.

Using this basic approach, I have learned how to write bash scripts,
do perl, etc etc. You start, and ask for help when you get stuck.

On Sun, Aug 19, 2012 at 1:54 PM, Michael Steele <michaels@go2dds.com> wrote:
> I know very little about creating a script under cygwin. I have a particular
> tack that doesn't change and I'm running it manually. I'm thinking that since
> it doesn't change that it could be automated. As you can see below I'm
> compiling three programs and the last program is my executable.
>
> The first time I setup the cygwin environment it doesn't need to 'make clean'.
> I'm not sure if it hurts to run 'make clean' if it doesn't need to. Maybe a
> check in place would be prudent if it shouldn't be running 'make clean if it
> doesn't need to?
>
> Here are the commands I run from within cygwin:
>
> Open the Cygwin terminal
>
> cd /cygdrive/e/development/cygwin/mysql-5.5.25a/
> make clean
> perl cmake/configure.pl
> make && make mysqlclient && make install
>
> cd /cygdrive/e/development/cygwin/postgresql-9.1.4/
> make clean
> ./configure
> make && make install
>
> cd /cygdrive/e/development/cygwin/barnyard2/
> make clean
> ./autogen.sh
> ./configure --with-mysql --with-postgresql
> make && make install
>
> When it completesw the process I need it to create a folder and copy all the
> prudent files and folder. I'm not sure if the below are correct syntax.
>
> mkdir /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/barnyard2/src/.libs/barnyard2.exe /cygdrive/e/cygwin/barn
> /
>
> cp /cygdrive/e/cygwin/barnyard2/etc/ /cygdrive/e/cygwin/barn/etc/
>
> cp /cygdrive/e/cygwin/barnyard2/schemas/ /cygdrive/e/cygwin/barn/schemas/
>
> cp /cygdrive/e/cygwin/barnyard2/etc/barnyard2.conf /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/bin/cyggcc_s-1.dll /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/bin/cygwin1.dll /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/bin/cygz.dll /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/usr/local/mysql/lib/cygmysqlclient-
> 18.dll /cygdrive/e/cygwin/barn/
>
> cp /cygdrive/e/cygwin/usr/local/pgsql/lib/cygpq.dll /cygdrive/e/cygwin/barn/
>
> then exit
>
>
> --
> Problem reports:       http://cygwin.com/problems.html
> FAQ:                   http://cygwin.com/faq/
> Documentation:         http://cygwin.com/docs.html
> Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple
>

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Fw: Re: Need help creating a script that is ran from a batch file.
       [not found] ` <20120820212619.M16512@ds.net>
@ 2012-08-21  1:51   ` Brian Wilson
  0 siblings, 0 replies; 3+ messages in thread
From: Brian Wilson @ 2012-08-21  1:51 UTC (permalink / raw)
  To: cygwin

Hi Michael

The Cygwin general group is probably not the best place to get help with 
scripting. Places like LinkedIn.com's discussion boards would be a better 
place for tutoring.  That said, there's nothing special about a script versus 
the commands you type in online.

Take the command you would normally run put 
them into a file with a editor such as VI, or Emacs (if you absolutely must), 
and give the file execute permissions. Congratulations you've just written 
your first script.

For use of things like variables and other options, I 
suggest you find a good book on either bash shell, or I like the book "the 
Korn shell command and programming language" by Korn and Bolsky [ISBN 0-13-
516972-0]. Much of what you can do in Korn shell can also be done in the bash 
shell (from a scripting perspective).

Sincerely,

Brian S. Wilson
============================================================================

> I know very little about creating a script under cygwin. I have a 
> particular tack that doesn't change and I'm running it manually. I'm 
> thinking that since it doesn't change that it could be automated. As 
> you can see below I'm compiling three programs and the last program 
> is my executable.
> 
> The first time I setup the cygwin environment it doesn't need to 
> 'make clean'. I'm not sure if it hurts to run 'make clean' if it 
> doesn't need to. Maybe a check in place would be prudent if it 
> shouldn't be running 'make clean if it doesn't need to?
> 
> Here are the commands I run from within cygwin:
> 
> Open the Cygwin terminal
> 
> cd /cygdrive/e/development/cygwin/mysql-5.5.25a/
> make clean
> perl cmake/configure.pl
> make && make mysqlclient && make install
> 
> cd /cygdrive/e/development/cygwin/postgresql-9.1.4/
> make clean
> ./configure
> make && make install
> 
> cd /cygdrive/e/development/cygwin/barnyard2/
> make clean
> ./autogen.sh
> ./configure --with-mysql --with-postgresql
> make && make install
> 
> When it completesw the process I need it to create a folder and copy 
> all the prudent files and folder. I'm not sure if the below are 
> correct syntax.
> 
> mkdir /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/barnyard2/src/.libs/barnyard2.exe 
/cygdrive/e/cygwin/barn
> /
> 
> cp /cygdrive/e/cygwin/barnyard2/etc/ /cygdrive/e/cygwin/barn/etc/
> 
> cp /cygdrive/e/cygwin/barnyard2/schemas/ /cygdrive/e/cygwin/barn/schemas/
> 
> cp /cygdrive/e/cygwin/barnyard2/etc/barnyard2.conf /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/bin/cyggcc_s-1.dll /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/bin/cygwin1.dll /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/bin/cygz.dll /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/usr/local/mysql/lib/cygmysqlclient-
> 18.dll /cygdrive/e/cygwin/barn/
> 
> cp /cygdrive/e/cygwin/usr/local/pgsql/lib/cygpq.dll /cygdrive/e/cygwin/barn/
> 
> then exit

--
Problem reports:       http://cygwin.com/problems.html
FAQ:                   http://cygwin.com/faq/
Documentation:         http://cygwin.com/docs.html
Unsubscribe info:      http://cygwin.com/ml/#unsubscribe-simple

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2012-08-20 21:37 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-08-19 19:55 Need help creating a script that is ran from a batch file Michael Steele
2012-08-19 21:18 ` Paul Thompson
     [not found] ` <20120820212619.M16512@ds.net>
2012-08-21  1:51   ` Fw: " Brian Wilson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).