If it issues a return code, this will be in the variable $? until you do something else. You can test for that:-
You can make your script exit with a non-zero return code by putting in exit 5 or whatever integer value you want (within reason)
Another way to do this is to make them dependant on each other with the && operator. This will move to the next if the return code is zero but quit that statement (carries on the the overall script) if any one of them fails:-
Do either of these meet your needs?
HI All,
I am working on Solaris 8, i have this application runing on one of the partitions,(the installation was done here ie /export/home)
And the out put of this goes to another parition of other disk attached to the same machine. After a certain period of time is get this error stating... (2 Replies)
I have a little bash script that includes make to compile with g++ and then a statement to actually run the compiled program. When it (the script) gets a syntax error, it does not abort and continues to run the previous version of the program.
How can I make the script abort when g++ generates a... (1 Reply)
Hi
I have written a script which returns a number. This resulting number I assign to the variable for example:
$ A=`get_dbnum 118 ttrn`
$ echo ${A}
8208
$
The script becomes interective once the error occures and the number is not found. It prompts the user to enter the number. The... (1 Reply)
Below is my shell script from which I am trying to invoke few Hive SQL queries and the below shell script works fine.
Problem Statement:-
If you see my first `hive -e` block in the below shell script which contains a very long Hive SQL query. Sometimes that Hive SQL query gets failed due to... (1 Reply)
Hi,
In my shell script I use the following code to copy files from one directory to other.
for file in `ls`; do
#----------------- Copy Files From INDIR to OUTDIR -------------#
echoen "Copying File ${INDIR}/$file to ${OUTDIR}/${file}"
cp ${INDIR}/$file ... (4 Replies)
Hi All,
I have a requirement where if Source Count is not equal to Target count, then I need to exit/abort the script and come out. Then send an email to thummi@email.com saying "RECORD COUNT DOES NOT MATCH. Please need your help.
Here is what I have written : If even the count is not... (1 Reply)
I want to abort script if input variable matched first field in any line of a file.
#!/bin/sh
read INPUTVAR1
awk "{if(\$INPUTVAR1 == $1) x = 1} END {if(x==1) print \"I want to abort script here\"; else print \"OK\"}" /etc/some.conf
I tried "exit" and system("exit") but no luck. (1 Reply)
Hi Team,
I my script i telent my node ip and after loging i run some commands...But some time login fail so i want to stop script at that time..
CONFIG_CHNG.sh
printf 'Please Input Node ID : '
read node
node="$node"
#exec > node_log_$node.log 2>&1
#set -x
>... (2 Replies)
Discussion started by: Ganesh Mankar
2 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)