Go Back   openSUSE Forums > Archives > SF Archives > ARCHIVES - Programming & Scripting
Forums FAQ Members List Search Today's Posts Mark Forums Read


ARCHIVES - Programming & Scripting A place to discuss website design, programming, shell scripts, etc

 
 
LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 11-May-2007, 01:59
maiden
Guest
 
Posts: n/a
Default

hi.
i need a start a lot of commands in console in many PC. for example
**************
cd /usr/local/nagios
cp bla bla
rcapache2 restart
bla bla
*************
how i can make a 1 file as in MUSTDIE - *.bat?

& run 1 file wich will be consist of all my commands?

tnx for help
  #2 (permalink)  
Old 11-May-2007, 03:14
Scribbler
Guest
 
Posts: n/a
Default

The simplest way to do it is put all your commands in a file. Then make it executable by using chmod, then you can execute the file as a script...

Example
Code:
#!/bin/sh
touch testfile
cat > testfile
echo test 1
ls
echo test 2
ls -a
echo test complete
<ctrl>-z

chmod +x testfile

./testfile
  #3 (permalink)  
Old 11-May-2007, 09:01
maiden
Guest
 
Posts: n/a
Default

Quote:
The simplest way to do it is put all your commands in a file. Then make it executable by using chmod, then you can execute the file as a script...

Example
Code:
#!/bin/sh
touch testfile
cat > testfile
echo test 1
ls
echo test 2
ls -a
echo test complete
<ctrl>-z

chmod +x testfile

./testfile
[/b]
thx a lot very tnx a lot. nice & simple
 

Bookmarks

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




 

Search Engine Friendly URLs by vBSEO 3.3.0 RC2