How to create an run a simple batch file?


 
Thread Tools Search this Thread
# 1  
How to create an run a simple batch file?

Hi,
So, I created a file named TEST.BAT in my home directory.

In it, I wrote:


#! /bin/bash
echo Hello


and then, saved the file.


Then, at the command-line interface, I typed TEST.BAT, but the command-line never executes the file and thus, never returns "Hello". It says "command not found".

I tried various combinaisons, such as TEST, 'TEST', "TEST", 'TEST.BAT' and "TEST.BAT". I also put "exec" in front of all these commands...but it still says "command not found".

Any help?
# 2  
...

did you try ./TEST.bat
# 3  
and did you try "chmod +x TEST.BAT"

Try to use UNIX naming conventions.
 

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #447
Difficulty: Medium
DebianDog is also Puppy Linux.
True or False?

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

To run a shell script in remote server from windows batch file

Hi all, i need to run a shell script on remote server. I have created file .bat file in windows server with following code, c:\Users\Desktop\putty.exe -ssh -pw password user@server ./script.sh i need to run the script.sh in my remote server Above command is not working, any... (4 Replies)
Discussion started by: rammm
4 Replies

2. Homework & Coursework Questions

Create a simple bash backup script of a file

This is the problem: Write a script that will make a backup of a file giving it a ‘.bak’ extension & verify that it works. I have tried a number of different scripts that haven't worked and I haven't seen anything really concise and to the point via google. For brevity's sake this is one of the... (4 Replies)
Discussion started by: demet8
4 Replies

3. Shell Programming and Scripting

How to run a script using batch file?

the manual process which we follow is login to remote unix box thro putty using the unix account and password and then sudo to root user. server name:abc@server.com login as:pqrst password:****** $ sudo su - root then run the script stored on remote server under root account. ... (9 Replies)
Discussion started by: gpk_newbie
9 Replies

4. Shell Programming and Scripting

Help making simple perl or bash script to create a simple matrix

Hello all! This is my first post and I'm very new to programming. I would like help creating a simple perl or bash script that I will be using in my work as a junior bioinformatician. Essentially, I would like to take a tab-delimted or .csv text with 3 columns and write them to a "3D" matrix: ... (16 Replies)
Discussion started by: torchij
16 Replies

5. Shell Programming and Scripting

help with email to be triggered based on fatal error detection from batch run log file neded

Hi, I require need help in two aspects actually: 1) Fatal error that gets generated as %F% from a log file say ABClog.dat to trigger a mail. At present I manually grep the log file as <grep %F% ABClog.dat| cut-d "%" -f1>. The idea is to use this same logic to grep the log file which is... (1 Reply)
Discussion started by: zico1986
1 Replies

6. UNIX for Dummies Questions & Answers

How to create a batch job ?

Hi In unix how to create a batch job and Is there any command to close file in unix. Please help me I am new to unix world (6 Replies)
Discussion started by: vinay.h4
6 Replies

7. Shell Programming and Scripting

Simple Batch File Help Needed

I have access to a large unix parallel computing cluster. To submit jobs I simply run a script called "submit" followed by options relevant to that particular job. Very simple and easy, "submit" can be run from any directory. I am trying to make a batch file that automatically runs "submit"... (5 Replies)
Discussion started by: cpabrego
5 Replies

8. UNIX for Dummies Questions & Answers

How can I run scripts in my unix account from batch file in Windows?

Hi all, I'm working on Windows, connecting to my Unix account by different ways: by FTP opening files in UltraEdit32, by mapping drive to browse, by Exceed or Telnet to compile at Unix account. Actually, that is what I would like to change: I'd like to make a batch file which would connect to... (7 Replies)
Discussion started by: olgafb
7 Replies

9. UNIX for Dummies Questions & Answers

How to create a simple todo file?

Hia all, I am trying to create a simple script, that will keep me a todo file/log. The idea is to have to scritps, one to enter a new todo file, one to delete (it can be one with different inputs, but this is not the point) e.g. > newEntry Call_home - will add a new line to the log like... (4 Replies)
Discussion started by: sierra_aar
4 Replies

Featured Tech Videos