Hi,
I am currently writing BASH shell scripts. I am using BASH on a Powerbook G4 running Leopard. Could somebody please explain the difference between
#!/bin/bash and #!/bin/sh?
I have been using the latter (#!/bin/sh), and things have been working fine. But is that the correct one to use... (9 Replies)
Do we need to include the exclamatory mark in the shebang line??:confused:
What if we dont include it??:eek:
Actually what shebang line implies when we run a script??
shebang line--> #!/bin/ksh :p (6 Replies)
*** EDIT: I found something close to my solution under an IIS 7 Module Handle.*****
(Non-Homework question, simply an ease of use one)
Odd question here and maybe its my newness to cgi/Perl, but is it possible to have 2 shebang lines?
I write an test a ton of my homework code on my windows... (1 Reply)
Hi,
I always thought that #!/usr/bin/ksh means that the script would be executed in korn shell i.e. when we'll execute the script with this line as the very first line then the shell spawns a korn shell (in this case as we are using #!/usr/bin/ksh ) and the script gets executed.
But I am... (7 Replies)
Hi ,
I know about the shebang line in shell scripting. Just want to know whether is there any difference in execution of the program by keeping and not keeping the shebang line. Because without shebang line also the script is working. correct me if am wrong. Any help on this will be helpful (5 Replies)
I see lot of ad-hoc shell scripts in our servers which don't have a shebang at the beginning .
Does this mean that it will run on any shell ?
Is it a good practice to create scripts (even ad-hoc ones) without shebang ? (16 Replies)
Hello All,
I was writing a Bash shell script that will be executed on both an AIX server (/usr/bin/ksh) and a SLES server (/bin/bash). The AIX server
has Bash installed at "/usr/bin/bash", which is in a different dir then the SLES server.
So basically I am writing the script on the SLES... (4 Replies)
Discussion started by: mrm5102
4 Replies
LEARN ABOUT LINUX
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.12.3 2011-06-11 Alien::Package::Rpm(3pm)