Sponsored Content
Top Forums Shell Programming and Scripting Ignore exit status for #!/bin/bash -e Post 302987566 by MadeInGermany on Monday 12th of December 2016 06:00:30 PM
Old 12-12-2016
Check if the destination exists before you make the link!
With a function
Code:
ln_s(){
  [[ -e $1 ]] && return
  ln -s "$1" "$2"
}
ln_s /u/force.sh stopf.sh
ln_s /u/tnohup.sh tnohup.sh
ln_s /u/quick.sh startquick

This User Gave Thanks to MadeInGermany For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

exit status

i downloaded a text file from metalab.unc.edu called sh.txt and in this reference manual it refers to shell scripting exit status .. at the end of one of the examples that author gave an exit status of 127.. to what does a 127 exit status refer too and what is its purpose in the code. moxxx68 (1 Reply)
Discussion started by: moxxx68
1 Replies

2. Shell Programming and Scripting

How to get exit status codes in bash from Perl?

I apologize if I have already posted this query. I scanned back quite a few pages but could not find such a query. If my perl code contains "exit(33)" how can I get that value in bash for use in a "if" statement. Thanks, Siegfried (5 Replies)
Discussion started by: siegfried
5 Replies

3. Shell Programming and Scripting

exit status for isql

I'm trying to write a script that will update a table in sysbase. If it's failed then I want to rerun it one more time before exiting the script (fail due to bad value such as trying to put a string into datetime field or bad connection to the database) Well my code below will always return... (2 Replies)
Discussion started by: sirrtuan
2 Replies

4. Shell Programming and Scripting

How to get the exit status

Hi all, I'm running a program which return 1 upon success. But when encounters problem shell return 's '1' . How to differentiate between them the shell return value and script return value. Ex. function fn return '1' if executed successfully and '0' if failed. But when if shell encounters... (1 Reply)
Discussion started by: yhacks
1 Replies

5. Shell Programming and Scripting

Exit status

I'm preparing for exam and one of exams is to write own test command... I wonder if in unix is a command which just returns exit code you specify.. I know I can easily write a function like this: exStatus() { return $1 } -> my question is rather theoretical thank you! (9 Replies)
Discussion started by: MartyIX
9 Replies

6. Shell Programming and Scripting

Exit status redirection

Hi, I'm having this simple code below, the file serverlist has a list of IPs one per line. When executed the while loop is executed only once, after that the program terminates. How should i redirect the exit status, so that the entire list of IP will get executed? #!/bin/bash exec <... (4 Replies)
Discussion started by: agent001
4 Replies

7. Shell Programming and Scripting

Exit Status

I have a shell script (#!/bin/sh) that interacts with Appworx and Banner Admin. In my script I want to check the exit status of awrun before continuing. awrun can run for 10 seconds or it can run for over a minute. So my question is, will it go through my if statement before awrun may even be... (2 Replies)
Discussion started by: smkremer
2 Replies

8. Shell Programming and Scripting

Want to get the exit status

Hi All, I am trying to create a zip file with all the txt files(these are in large number) in the current directory. I am able to do this operation sucessfully. After this i want to get the status of the tar command executed and do accordingly. When i am trying with the below code, the status... (3 Replies)
Discussion started by: paddu
3 Replies

9. Shell Programming and Scripting

Usage of #!/bin/sh vs #!/bin/bash shell scripts?

Some question about the usage of shell scripts: 1.) Are the commands of the base shell scripts a subset of bash commands? 2.) Assume I got a long, long script WITHOUT the first line. How can I find out if the script was originally designed für "sh" or "bash"? 3.) How can I check a given... (3 Replies)
Discussion started by: pstein
3 Replies

10. UNIX for Beginners Questions & Answers

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed

In Bash shell - the ps -ef shows only the /bin/bash but the script name is not displayed ? Is there any way to get the script names for the process command ? --- Post updated at 08:39 AM --- in KSH (Korn Shell), my command output shows the script names but when run in the Bash Shell... (3 Replies)
Discussion started by: i4ismail
3 Replies
B::Hooks::OP::Check(3)					User Contributed Perl Documentation				    B::Hooks::OP::Check(3)

NAME
B::Hooks::OP::Check - Wrap OP check callbacks SYNOPSIS
# include "hook_op_check.h" STATIC OP *my_const_check_op (pTHX_ OP *op, void *user_data) { /* ... */ return op; } STATIC hook_op_check_id my_hook_id = 0; void setup () CODE: my_hook_id = hook_op_check (OP_CONST, my_const_check_op, NULL); void teardown () CODE: hook_op_check_remove (OP_CONST, my_hook_id); DESCRIPTION
This module provides a c api for XS modules to hook into the callbacks of "PL_check". ExtUtils::Depends is used to export all functions for other XS modules to use. Include the following in your Makefile.PL: my $pkg = ExtUtils::Depends->new('Your::XSModule', 'B::Hooks::OP::Check'); WriteMakefile( ... # your normal makefile flags $pkg->get_makefile_vars, ); Your XS module can now include "hook_op_check.h". TYPES
typedef OP *(*hook_op_check_cb) (pTHX_ OP *, void *); Type that callbacks need to implement. typedef UV hook_op_check_id Type to identify a callback. FUNCTIONS
hook_op_check_id hook_op_check (opcode type, hook_op_check_cb cb, void *user_data) Register the callback "cb" to be called after the "PL_check" function for opcodes of the given "type". "user_data" will be passed to the callback as the last argument. Returns an id that can be used to remove the callback later on. void *hook_op_check_remove (opcode type, hook_op_check_id id) Remove the callback identified by "id". Returns the userdata the callback had. AUTHOR
Florian Ragwitz <rafl@debian.org> COPYRIGHT AND LICENSE
Copyright (c) 2008 Florian Ragwitz This module is free software. You may distribute this code under the same terms as Perl itself. perl v5.18.2 2011-09-10 B::Hooks::OP::Check(3)
All times are GMT -4. The time now is 06:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy