as i said before i'm a beginner in shell programming and i have two questions:
how to run an executable file win shell scripts like for example let's say the file called "prog.exe", what's the shell command to run this file?
also how can i make the shell file an executable file (if it is "file.sh" i want it to be "file.exe")?
The command to run the program is:
if your current working directory is where the file lives. You can leave out the ./ if the executable is in your path. You can see your path by typing "echo $PATH" at the command line, and you can add directories to your path in your environment with the export command if you have a place you like to keep your scripts.
Also, you're thinking in "Windows," where file extensions tell the operating system what kind of file it is. Things don't work that way in Unix. The operating system knows whether a file is executable by looking at the executable flag. You could name it "cheese.etaothuaos" and it could still be an executable.
As a side note, you may have noticed the "shebang line" in other people's scripts. If you have a bash script, the first line of the file should be:
If you have a Perl script, it should be:
And so on. So when you run the program by typing ./file_name, the OS knows whether it should be running bash, korn shell, Perl, Python, or whatever. Of course, this changes once you're actually compiling your code into a binary file, like with C.
well i want to be file.exe because i have linux and windows OS and i need the program to be executed in both also i want it to work forever and using SFU in windows is not that good
also i forget to mention in my question the path to the prog.exe is:
id address/path/to/prog.exe
i mean the program is not on the same computer it's on another computer connected via lan network and nfs
as far as i know, unfortunately you cannot make one program to run equally in both. you will have to write separate programs for each OS. one for linux/unix, one for windows and your windows program will usually have to be created/compiled in the windows environment.
now if it is doing something like accessing a database, you can have one database sitting on say the unix box and have a program on each machine that can both access that one database. but again the program to do so would be separate for each OS.
well i want to be file.exe because i have linux and windows OS and i need the program to be executed in both also i want it to work forever and using SFU in windows is not that good
also i forget to mention in my question the path to the prog.exe is:
id address/path/to/prog.exe
i mean the program is not on the same computer it's on another computer connected via lan network and nfs
That will not work. What kind of file is it? If it's a Perl or Python script, it's possible (depending on how it's written and what it does) to run it without changes on Unix and Windows, but you'd need to use the .pl or .py extension. If it's a compiled program written in, for example, C++, you'd need to compile it separately for Unix and Windows.
In any case, calling something a .exe is meaningless -- it doesn't actually do anything. If it's actually a .exe file compiled for Windows, then it lets Windows know that it's an executable file, but the actual format of the file has to also match what Windows expects a .exe to look like.
Dear all,
I download a .exe file in my current folder called: ukbmd5.exe. I was told to run the command below: ukbmd5 ukb25278.enc to verify the integrity of the files that you have downloaded and the program ukbmd5 has been made available to assist with decrpying ukb25278.enc.
while when I run... (1 Reply)
So I have a file called queens.cc and I need to do the following:
Compile and make a .o file while specifying that the compiler is to search /student/214/include for system include files.
Use g++, link and load .o file to make a dynamically linked executable file called queens and to also... (1 Reply)
Hello everyone,
The following are my input files.
The following are my sequence of steps.
Can someone please let me know about how to make these bunch of steps into a single script so that I start the script with 1.txt and 2.txt, after execution gives me the final... (11 Replies)
Hello,
Is there any method thorugh which script can take argument if pass otherwise if argument doesn't pass then it takes the argument from the configuration file
i.e I am workiing on a script which will run through crontab and the script will
chekout the code ,zip and copy to the... (3 Replies)
Hello Forum Memebers,
I have file with exension of .shsrc ie(startA.shsrc) .while iam trying to make ,its getting Ksh not found.
file:startA.shsrc
error:KSH not found
the content about shell declaration in the korn shell is below.
... (3 Replies)
Dear list
its my first post and i would like to greet everyone
What i would like to do is select records 7 and 11 from each files in a folder then run an executable inside the script for the selected parameters.
The file format is something like this
7 100 200
7 100 250
7 100 300 ... (1 Reply)
Hello everybody,
I'm unable to make my shell script an executable file.
The details are as follows:
PATH includes my $HOME/bin i.e. /rchome/rc1/bin
HOME directory is /rchome/rc1
script name is prep_mig.sh permissions set are 755
It's executing if I give below command
sh prep_mig.sh
but... (4 Replies)
I have a script in my home direcroty which upon execution gives the essential system information like memory,cpu etc and is currently owned by root:root. Now I want to see that every non root user will run this file and grab the reqired system info. I know this is some thing associated with chown... (2 Replies)
I'm trying to set up a form mail script on a website that when Submitted, a cgi script is executed and a perl translator (located in a secured and inaccessible folder) translates the script. After speaking to my hosting provider, I was told to "Telnet into the system and make the script... (2 Replies)