09-01-2012
Thank you
Thank you very much Jim, that does work.
But this is still different behavior than a more traditional linux/unix release. Because typically when not putting the shebang in a script then the shell you are running will be used to execute it, and like you explain it will fork & exec but you will still get a permission denied without +x being on.
I am new to cygwin, but I know for example in RedHat with or without shebang it will not run directly without +x on the file.
This will work for the purposes of using cygwin to teach shell scripting, but that behavior is not typical. I will just make sure I add the #! to illustrate the different ways to execute a shell script
Larry
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi,
I installed Cygwin y'day on Win XP SP2.
The install went fine but when I clicked on Cygwin's shortcut to invoke its shell, it didn't come up.....was just opening for a fraction of second and then closed.
Can anyone please advise?
Regards
er_ashu (6 Replies)
Discussion started by: er_ashu
6 Replies
2. Shell Programming and Scripting
I haven't been on a unix system in a long time and I'm trying to teach a friend unix. After looking at/testing various options cygwin seemed to be the easiest to download and install.
Everything works pretty much as I recall and I even tested a small java program on it.
I can't seem to get... (4 Replies)
Discussion started by: mmtemp
4 Replies
3. Shell Programming and Scripting
Hi all ,
I need to call an executable (.exe) using shell script.
Actual need is i need to call that shell script and do an export of some tables
is there any way . the executable is datamover
Please let me know if there are any option !! (2 Replies)
Discussion started by: raghav1982
2 Replies
4. Shell Programming and Scripting
I'm using cygwin under WinXP.
When I write things like ls > list.txt in shell, it works OK.
But when I place it to file like this:
It says that "list.txt" doesn't exists.
I tried touch, but the answer is the same. (2 Replies)
Discussion started by: TeenageWerewolf
2 Replies
5. Shell Programming and Scripting
hi,
I am using Cygwin for running the shell script.
If i execute the following command at the prompt output is obtained.
grep echo *
The same i have put in a file and when am trying to execute it is throwing error.
IP.sh
echo "Starting command..........."
grep echo *
... (9 Replies)
Discussion started by: flamingo_l
9 Replies
6. Shell Programming and Scripting
I would like to make a script that I can see if the file is executable. If it is executable then it needs to run. Otherwise, if it is not executable the file needs to be edited, and run agian.
I hope you understand what i mean. :)
Thanks for the netherlands (4 Replies)
Discussion started by: dennisbest85
4 Replies
7. UNIX for Dummies Questions & Answers
Hi!I'm new in this forum,also in shell scripting! :P
I'd like to help me with an issue!the project wants to make a variable with a directory(any) and then print all executable files of this directory,sorted by size!Thank you! (8 Replies)
Discussion started by: strawhatluffy
8 Replies
8. UNIX Desktop Questions & Answers
Hi Friends,
I have a shell script which does some operations etc, would it be possible to create an executable file out from this shell script? meaning the executable file is not editable, thus the source code will not be visible to other users for copyright reasons.
Please help, thanks! (1 Reply)
Discussion started by: kokoro
1 Replies
9. Programming
Ok I feel kind of stupid asking since it's been a while since I used an UNIX system but here goes. I recently installed the full CYGWIN on my Windows 7 machine. Seem like a nice package. So to test it out I did the basic hello world deal. It compiles just fine. But when I run it it crashed :(. So I... (4 Replies)
Discussion started by: g8rmark
4 Replies
10. Shell Programming and Scripting
I have a file with below format :
2013-05-20 hello
has done
2013-05-20 hi
000abc
abc
2013-05-21 thank you
I want the out put to be like this :
2013-05-20 hello has done
2013-05-20 hi 000abc abc
2013-05-21 thank you
What I could think of is something like this :
cat... (7 Replies)
Discussion started by: Sparta
7 Replies
LEARN ABOUT DEBIAN
alien::package::rpm
Alien::Package::Rpm(3pm) User Contributed Perl Documentation Alien::Package::Rpm(3pm)
NAME
Alien::Package::Rpm - an object that represents a rpm package
DESCRIPTION
This is an object class that represents a rpm package. It is derived from Alien::Package.
FIELDS
prefixes
Relocatable rpm packages have a prefixes field.
METHODS
checkfile
Detect rpm files by their extention.
install
Install a rpm. If RPMINSTALLOPT is set in the environement, the options in it are passed to rpm on its command line.
scan
Implement the scan method to read a rpm file.
unpack
Implement the unpack method to unpack a rpm file. This is a little nasty because it has to handle relocatable rpms and has to do a bit
of permissions fixing as well.
prep
Prepare for package building by generating the spec file.
cleantree
Delete the spec file.
build
Build a rpm. If RPMBUILDOPT is set in the environement, the options in it are passed to rpm on its command line.
An optional parameter, if passed, can be used to specify the program to use to build the rpm. It defaults to rpmbuild.
version
Set/get version.
When retreiving the version, remove any dashes in it.
postinst
postrm
preinst
prerm
Set/get script fields.
When retrieving a value, we have to do some truely sick mangling. Since debian/slackware scripts can be anything -- perl programs or
binary files -- and rpm is limited to only shell scripts, we need to encode the files and add a scrap of shell script to make it
unextract and run on the fly.
When setting a value, we do some mangling too. Rpm maintainer scripts are typically shell scripts, but often lack the leading shebang
line. This can confuse dpkg, so add the shebang if it looks like there is no shebang magic already in place.
Additionally, it's not uncommon for rpm maintainer scripts to contain bashisms, which can be triggered when they are ran on systems
where /bin/sh is not bash. To work around this, the shebang line of the scripts is changed to use bash.
Also, if the rpm is relocatable, the script could refer to RPM_INSTALL_PREFIX, which is set by rpm at run time. Deal with this by
adding code to the script to set RPM_INSTALL_PREFIX.
arch
Set/get arch field. When the arch field is set, some sanitizing is done first to convert it to the debian format used internally. When
it's retreived it's converted back to rpm form from the internal form.
AUTHOR
Joey Hess <joey@kitenet.net>
perl v5.14.2 2011-08-05 Alien::Package::Rpm(3pm)