07-17-2006
So does that mean I don't need to put "exit $exit_val", but instead just "echo $exit_val"? Or do I still need that exit statement in my function?
9 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config.
I am not sure if I can do this with BASH scripting.
I have set up password less login by adding my public key to authorized_keys file, it works.
I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies
2. UNIX for Dummies Questions & Answers
My job is launched using this command: I'm at home and having VPN drops so I used nohup and background.
nohup perf_mon -c rating_4_multi,cfg &
The main script is PID 26119, and the sub task under it is 26118 which is not running - just sits there. 26119 runs forever but nothing else runs. I... (2 Replies)
Discussion started by: ido1957
2 Replies
3. Shell Programming and Scripting
Hello Friends,
Hope you are doing well.
I just need a help in executing multiple processes.
I've written a shell script which calls another scritps. But the problem is there are too many processes to run, and each process takes about a min to finish its execution.
So, I want to just... (3 Replies)
Discussion started by: singh.chandan18
3 Replies
4. Shell Programming and Scripting
I have a script that writes another script with
cat >/usr/local/bin/myscript.sh <<EOF
#!/bin/sh
VAR=`run a command here`
EOF
Problem is, after this is run, I get:
$ cat /usr/local/bin/myscript.sh
#!/bin/sh
VAR=result of command
How do I stop that from happening with Macs... (2 Replies)
Discussion started by: jnojr
2 Replies
5. UNIX for Dummies Questions & Answers
Hi All,
I have one shell script start.sh which executes another shell script test.sh something like below :test.sh -param1 -param2
In the test.sh there is one command for removing file:rm file1.bak
I want whenever I execute start.sh, it will execute test.sh and if it finds string rm... (7 Replies)
Discussion started by: ORAI
7 Replies
6. Shell Programming and Scripting
Hi,
I am writing shell script to automate few use cases for CLI interface. We have CLI interface which has bunch of commands. I am trying to execute one of the commands 'exit' as part of automation to exit from CLI object (not from shell script) in my shell script.
My intension is to execute... (4 Replies)
Discussion started by: Mahesh Desai
4 Replies
7. Programming
I had been looking at page 75 of this online book:
http://richard.esplins.org/static/downloads/linux_book.pdf
I've used the system function in C to call bash commands before, but wanted to learn this way too. The solution in the book worked perfectly. However, I tried changing the simple "ls -l... (3 Replies)
Discussion started by: Azrael
3 Replies
8. AIX
Greetings all,
I am using an enterprise utility for document archiving. This program calls a custom C exit to do data manipulation before loading data into the archive.
When the program is called via an automation script (Ran as ROOT), program successfully executes the C exit, and gives me an... (3 Replies)
Discussion started by: jeffs42885
3 Replies
9. Shell Programming and Scripting
I have a script that checks if the script has been ran with sudo.
If the script is not ran as sudo, the current script is being executed with exec sudo bash.
You are asked for a password, you type in the password, success. Everything is perfect - the commands inside the script are ran as sudo.... (1 Reply)
Discussion started by: boqsc
1 Replies
LEARN ABOUT MOJAVE
autouse5.18
autouse(3pm) Perl Programmers Reference Guide autouse(3pm)
NAME
autouse - postpone load of modules until a function is used
SYNOPSIS
use autouse 'Carp' => qw(carp croak);
carp "this carp was predeclared and autoused ";
DESCRIPTION
If the module "Module" is already loaded, then the declaration
use autouse 'Module' => qw(func1 func2($;$));
is equivalent to
use Module qw(func1 func2);
if "Module" defines func2() with prototype "($;$)", and func1() has no prototypes. (At least if "Module" uses "Exporter"'s "import",
otherwise it is a fatal error.)
If the module "Module" is not loaded yet, then the above declaration declares functions func1() and func2() in the current package. When
these functions are called, they load the package "Module" if needed, and substitute themselves with the correct definitions.
WARNING
Using "autouse" will move important steps of your program's execution from compile time to runtime. This can
o Break the execution of your program if the module you "autouse"d has some initialization which it expects to be done early.
o hide bugs in your code since important checks (like correctness of prototypes) is moved from compile time to runtime. In particular,
if the prototype you specified on "autouse" line is wrong, you will not find it out until the corresponding function is executed. This
will be very unfortunate for functions which are not always called (note that for such functions "autouse"ing gives biggest win, for a
workaround see below).
To alleviate the second problem (partially) it is advised to write your scripts like this:
use Module;
use autouse Module => qw(carp($) croak(&$));
carp "this carp was predeclared and autoused ";
The first line ensures that the errors in your argument specification are found early. When you ship your application you should comment
out the first line, since it makes the second one useless.
AUTHOR
Ilya Zakharevich (ilya@math.ohio-state.edu)
SEE ALSO
perl(1).
perl v5.18.2 2013-11-04 autouse(3pm)