batch file equivalent for Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users batch file equivalent for Unix
# 1  
Old 10-12-2005
batch file equivalent for Unix

i was trying to do a simple batch file equivalent in Unix

when i write a single command in a file, give executable permissions and run it (i gave the file name as a command at the prompt), it works fine.
but when i have more than 1 command, say my file has

a.out
ls
ls
a.out

it doesnt recognize any of the commands. any suggestions ....
do i need to do in different way? please help

Thanks
# 2  
Old 10-12-2005
Unlike DOS, your PATH must reference the current directory or you must reference the location of your executable.
Code:
a.out

would look like this to execute it from your current directory:

./a.out

Alternatively but discouraged, you would specify [b].[b] in your PATH variable.  For example:
export PATH=$PATH:.

by the way, ls should not be failing in the script.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Linux equivalent for UNIX

I have a folder called "log" which has a few sub-folders say "fda" "fd7" "fdd" "fd6 .... " I wish to fire the below command inside each subfolder starting with the folder with the latest time stamp. grep "$greptime.*exit" Prod.$(hostname).log | grep $fdrdate_new If the seach did not yield... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. UNIX for Dummies Questions & Answers

Locate equivalent in UNIX

Hi All, I am a frequent user of loacate in linux and really impressed with its speed and accuracy. I would like to know if there is any such equivalent in UNIX. (not the find, which is relatively very slow) Any locate packages which can be made available in UNIX(HP-UX) for this? TIA,... (4 Replies)
Discussion started by: pradebban
4 Replies

3. Shell Programming and Scripting

Batch job in unix server to move the pdf file from unix to windows.

Hi Experts, I have a requirement where i need to setup a batch job which runs everymonth and move the pdf files from unix server to windows servers. Could some body provide the inputs for this. and also please provide the inputs on how to map the network dirve in the unix like that... (1 Reply)
Discussion started by: ger199901
1 Replies

4. Shell Programming and Scripting

Executing Windows batch file from UNIX

Hi everyone, let me get straight to the points. My manager wants to execute a remote batch file (on a Windows server) from a UNIX Machine, does anyone know if this is possible and what packages would be needed? Thanks p.s. Sorry i cant give OS specifics, we use most UNIX's; AIX, Solaris,... (5 Replies)
Discussion started by: flip387
5 Replies

5. UNIX for Dummies Questions & Answers

A mechanism like "batch file of windows" in Unix

Hi all, Like in windows OS we have in unix something called "jobs"-term me if i am wrong- to run a sequence of steps which we can exceute at our own will without scheduling like corntab scheduling. can any one tell me what is the structure of this file and provide me with some info with this... (5 Replies)
Discussion started by: aixjadoo
5 Replies

6. UNIX for Dummies Questions & Answers

Equivalent of Substr in Unix

Hi, I have a shell variable which has a value 123456:abcdeg. I want to extract the value which is present before ":". Is there any command in Unix through which I can achieve this. Please suggest. Thanks, Saurabh (7 Replies)
Discussion started by: saurabhsinha23
7 Replies

7. Programming

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (2 Replies)
Discussion started by: anjan_kumar_k
2 Replies

8. UNIX for Advanced & Expert Users

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (1 Reply)
Discussion started by: anjan_kumar_k
1 Replies

9. 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

10. UNIX for Dummies Questions & Answers

UNIX Batch FTP Command file

Hello, I am a UNIX newbie and this is my first posting. I need to create a batch command file to ftp from Sun/Solaris to AS/400. Here is an example file: ftp -d -i -n -v 172.28.16.22 pwd ls binary quit This is the result of executing the command file: Connected to... (10 Replies)
Discussion started by: pietro
10 Replies
Login or Register to Ask a Question