[wplug] *.bat files

terry mcintyre terrymcintyre at yahoo.com
Tue May 18 09:04:41 EDT 2004


The "batch file" - or "script" as we say in Unix - 
creats a new shell, then executes commands inside 
of that shell. When finished, the shell exits,
leaving you in your original shell, which is why
you don't see the effect of the cd command. The
cd happened inside of a separate shell; it does
not effect the parent shell.

You might want to create a function to perform
these commands. Details depend on which shell
you are using.

Type "echo $SHELL", and let us know what shell
you are using, and perhaps someone can take it from
there.


--- "Weber, Larry A" <laweber at switch.com> wrote:
> Tried this batch file and found that it created a
> new directory and cleared
> the terminal.  Would not cd to the new directory????
> 
> > -----Original Message-----
> > From:	wplug-bounces+laweber=switch.com at wplug.org
> > [SMTP:wplug-bounces+laweber=switch.com at wplug.org]
> On Behalf Of Jason Carr
> > Sent:	Tuesday, May 18, 2004 8:06 AM
> > To:	'General user list'
> > Subject:	RE: [wplug] *.bat files
> > 
> > 1. Create a file called 'test.sh' and edit that
> file.
> > 2. The first line should say #!/bin/sh
> > 3. Put the rest of the commands on their own lines
> > 4. The result should be as follows:
> > 
> > #!/bin/sh
> > mkdir newfile
> > cd newfile
> > clear
> > 
> > The #!/bin/sh is which shell interpreter is used
> so you may need to change
> > that depending on which Linux distro you use.
> > 
> > 5. To make it executable, type chmod u+x test.sh
> > 6. Now you can type /home/jason/test.sh (or where
> ever it might be.
> > 
> > Any more questions, feel free to ask :)
> > 
> > - Jason
> > 
> > 
> > -----Original Message-----
> > From: wplug-bounces+jason=flacid.org at wplug.org
> > [mailto:wplug-bounces+jason=flacid.org at wplug.org]
> On Behalf Of Amjed Ben
> > Salah
> > Sent: Tuesday, May 18, 2004 7:59 AM
> > To: wplug at wplug.org
> > Subject: [wplug] *.bat files
> > 
> > Hello,
> > can someone tell me how to create files in linux
> like *.bat files in
> > MSDOS?
> > for example I want to create a program who does
> this:
> > 
> > 1 $> mkdir newfile
> > 2 $>cd newfile
> > 3 $>clear
> > 
> > regards
> >
>
_____________________________________________________________________
> > Endlich SMS mit Bildern versenden! Das Bild selbst
> ist dabei gratis,
> > Sie bezahlen lediglich den Versand.
> http://freemail.web.de/?mc=021195
> > 
> > _______________________________________________
> > wplug mailing list
> > wplug at wplug.org
> > http://www.wplug.org/mailman/listinfo/wplug
> > 
> > 
> > _______________________________________________
> > wplug mailing list
> > wplug at wplug.org
> > http://www.wplug.org/mailman/listinfo/wplug
> _______________________________________________
> wplug mailing list
> wplug at wplug.org
> http://www.wplug.org/mailman/listinfo/wplug


=====
Terry McIntyre
UNIX for hire
software development / systems administration / security

(412)334-1006
terrymcintyre at yahoo.com


	
		
__________________________________
Do you Yahoo!?
SBC Yahoo! - Internet access at a great low price.
http://promo.yahoo.com/sbc/



More information about the wplug mailing list