Bash Script

OOzy Pal oozypal at gmail.com
Thu Jan 11 18:32:34 UTC 2007


On 1/11/07, Ouattara Oumar Aziz <wattazoum at gmail.com> wrote:
> OOzy Pal :
> > The script below check my project directory and adds a new project.
> > For example if the projects I have are:
> >
> > 000-X
> > 001-Y
> >
> > runnign the script as
> >
> > script Z
> >
> > will add a new project 003-Z
> >
> > but How about if I do
> >
> > script Z
> >
> > again? The script will add another project as 004-Z. I would like to
> > modify the script so it check if the project already exist them it
> > should not create a new one. It should create the same project with
> > the same old number
> >
> > script Z
> >
> > should not create 004-Z; no, it should recreate 003-Z again.
> >
>
> Are you sure you want to recreate it ? I think you may just cancel since
> it already exists. Anyway that's your script :)
>
> try that one
>
>
> # first create dirs for test
> wattazoum at wattazoum-laptop:~$ file=MyTest
> wattazoum at wattazoum-laptop:~$ mkdir 230-$file
> wattazoum at wattazoum-laptop:~$ mkdir 240-pre$file
> wattazoum at wattazoum-laptop:~$ mkdir 231-
> wattazoum at wattazoum-laptop:~$ mkdir 231-{$file}sup
> # here is the test
> wattazoum at wattazoum-laptop:~$ ls | grep [0-9][0-9][0-9]-$file$
>
> You can put it in a var and do whatever you want.
>
>
> --
> ubuntu-users mailing list
> ubuntu-users at lists.ubuntu.com
> Modify settings or unsubscribe at: https://lists.ubuntu.com/mailman/listinfo/ubuntu-users
>

Hmmm, I am still having problem integerating your commands in my
script :( sorry.

-- 
OOzy
Kubuntu-Edgy




More information about the ubuntu-users mailing list