batch commands file and background

batch commands file and background

Post by Guillaume Boudrea » Fri, 07 Feb 1997 04:00:00



Hi,

        I'm working on a SUN SPARCstation 4 at school and I have two problem:

        How can I change the background??? It's a (ugly) green and I want to
put an other color or maybe an image...

        How can I do a batch file?  I want to run several command lines one
after each other... Exemple: cp * /tmp
                  gunzip *.gz
                  tar xvf *.tar

        I've tried to put it in a menu item but the system tried to do
everything at the same time... but it can't untar the files that were
not already gunzipped...

                Thanks

                        Guillaume


----------------------------------------------------------------------------

"Un train se deplace dix fois plus vite qu'un bateau.  Si un train prend
dix heures pour couvrir une distance de 600 kilometres, imaginez le
temps
qu'un bateau prendra et trouvez une seule bonne raison pour prendre le
bateau.  Calculez l'age du capitaine."
                                                  __  _
|\/|   _____    |\ |                |O      O    |   |_      |\ |  /\
|  | O  | |     | \|  -  |_|   /\   |   |      - |   |_  |O  | \| /--\
|\ |
        | |  O           | |  /--\      |__      |__     |\            |
\|

 
 
 

batch commands file and background

Post by Brian S. Craigie - Unix SA - NEC - Scotla » Sat, 08 Feb 1997 04:00:00




Quote:> Hi,

Bonjour.

Quote:

>    I'm working on a SUN SPARCstation 4 at school and I have two problem:

>    How can I change the background??? It's a (ugly) green and I want to
> put an other color or maybe an image...

Are you using openwindows or CDE?

Quote:

>    How can I do a batch file?  I want to run several command lines one
> after each other... Exemple: cp * /tmp
>              gunzip *.gz
>              tar xvf *.tar

You can either put the commands on one line separated by semicolon ; or

Create a file, say ~/zippy using vi or favourite editor. enter the following
into the file:
#!/bin/ksh
cp * /tmp; gunzip *.gz; tar xvf *.tar

The first line must be #!/bin/ksh entered with no spaces.  You can change ksh to
sh or csh, but ksh is best for shell programming (IMHO).

Then execute the command 'chmod a+x ~/zippy' to make it executable.  To execute
the commands, just type 'zippy' (omit the ' signs)

You might do this a different way:

for file in *;do
gzip -dc $file | tar xvf -
done

This leaves the original xxx.gz file in place, but also gives you the untarred
final result.  This saves you later gzipping again when you are finished.

You could also do:

#!/bin/ksh

cd $1;gzip -dc $2 | tar xvf

in a file and then call it as follows:

zippy /tmp /a_file/somewhere.tar.gz

The $1 is replaced by /tmp and the $2 is replaced by /a_file.....

Quote:>    I've tried to put it in a menu item but the system tried to do
> everything at the same time... but it can't untar the files that were
> not already gunzipped...

>            Thanks

>                    Guillaume

De rien.

--

Best Regards,

Brian S. Craigie
Unix Sysadmin
NEC Semiconductors (UK) Ltd

< Of course I'm not speaking for my employer.  I'm not even speaking for me! >

 
 
 

batch commands file and background

Post by Brian S. Craigie - Unix SA - NEC - Scotla » Sat, 08 Feb 1997 04:00:00




Quote:> Hi,

Bonjour.

Quote:

>    I'm working on a SUN SPARCstation 4 at school and I have two problem:

>    How can I change the background??? It's a (ugly) green and I want to
> put an other color or maybe an image...

Are you using openwindows or CDE?

Quote:

>    How can I do a batch file?  I want to run several command lines one
> after each other... Exemple: cp * /tmp
>              gunzip *.gz
>              tar xvf *.tar

You can either put the commands on one line separated by semicolon ; or

Create a file, say ~/zippy using vi or favourite editor. enter the following
into the file:
#!/bin/ksh
cp * /tmp; gunzip *.gz; tar xvf *.tar

The first line must be #!/bin/ksh entered with no spaces.  You can change ksh to
sh or csh, but ksh is best for shell programming (IMHO).

Then execute the command 'chmod a+x ~/zippy' to make it executable.  To execute
the commands, just type 'zippy' (omit the ' signs)

You might do this a different way:

for file in *;do
gzip -dc $file | tar xvf -
done

This leaves the original xxx.gz file in place, but also gives you the untarred
final result.  This saves you later gzipping again when you are finished.

You could also do:

#!/bin/ksh

cd $1;gzip -dc $2 | tar xvf -

in a file and then call it as follows:

zippy /tmp /a_file/somewhere.tar.gz

The $1 is replaced by /tmp and the $2 is replaced by /a_file.....

Quote:>    I've tried to put it in a menu item but the system tried to do
> everything at the same time... but it can't untar the files that were
> not already gunzipped...

>            Thanks

>                    Guillaume

De rien.

--

Best Regards,

Brian S. Craigie
Unix Sysadmin
NEC Semiconductors (UK) Ltd

< Of course I'm not speaking for my employer.  I'm not even speaking for me! >

 
 
 

1. batch commands file and background on SUN

Hi,

        I'm working on a SUN SPARCstation 4 at school and I have two problem:

        How can I change the background??? It's a (ugly) green and I want to
put an other color or maybe an image...

        How can I do a batch file?  I want to run several command lines one
after each other... Exemple: cp * /tmp
                  gunzip *.gz
                  tar xvf *.tar

        I've tried to put it in a menu item but the system tried to do
everything at the same time... but it can't untar the files that were
not already gunzipped...

                Thanks

                        Guillaume


----------------------------------------------------------------------------

"Un train se deplace dix fois plus vite qu'un bateau.  Si un train prend
dix heures pour couvrir une distance de 600 kilometres, imaginez le
temps
qu'un bateau prendra et trouvez une seule bonne raison pour prendre le
bateau.  Calculez l'age du capitaine."
                                                  __  _
|\/|   _____    |\ |                |O      O    |   |_      |\ |  /\
|  | O  | |     | \|  -  |_|   /\   |   |      - |   |_  |O  | \| /--\
|\ |
        | |  O           | |  /--\      |__      |__     |\            |
\|

2. 3Com 507 cards

3. batch commands and background image on SUN SPARCstation 4

4. Columbia Appletalk project

5. Batch Files: Why is it the only the last line of the batch files is executing?

6. Swap Partition has become "unconfigured"

7. How do I fork a process from a batch file (including using the eval command)

8. RPM Update

9. How to create batch file that replaces standard Unix commands?

10. What command in a file batch do logout user (Unix or Linux)?

11. C shell command to use 'file' command to automatically scale a file

12. Matrox Mystique ands X.

13. Batch file to Shell file - Conversion