newby bash script question

Alex Maynard maynarda-dxuVLtCph9gsA/PxXw9srA at public.gmane.org
Sat Sep 1 23:01:45 UTC 2007



On Sat, 1 Sep 2007, Lennart Sorensen wrote:

> On Sat, Sep 01, 2007 at 03:59:03PM -0400, Alex Maynard wrote:
>> It boils down to not being able to cd properly inside a bash  script.
>>
>> What I am trying to is to run a script from directory A
>> A$./script
>> That would have the same effect as using cd to get to directory
>> B and then running a file. Specifically, I would like the script to do
>> the command line equivalent of:
>>
>> A$ cd B
>> B$ latex file.tex
>
> How about:
>
> #!/bin/bash
> pushd B
> latex file.tex
> popd
>

Thank you very much. That did just what I was looking for.

Alex

>
> --
> Len Sorensen
> --
> The Toronto Linux Users Group.      Meetings: http://gtalug.org/
> TLUG requests: Linux topics, No HTML, wrap text below 80 columns
> How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists
>
--
The Toronto Linux Users Group.      Meetings: http://gtalug.org/
TLUG requests: Linux topics, No HTML, wrap text below 80 columns
How to UNSUBSCRIBE: http://gtalug.org/wiki/Mailing_lists





More information about the Legacy mailing list