Sponsored Content
Top Forums Shell Programming and Scripting Possible to use /usr/bin/watch to call a function? Post 302678909 by Lem on Monday 30th of July 2012 03:43:11 AM
Old 07-30-2012
Quote:
Originally Posted by graysky
Solved...
Code:
export -f bar

Of course, but it shouldn't be enough (it isn't enough here, at least).

Code:
two)
    export -f bar
    /usr/bin/watch "bash -c bar"
    ;;

--
Bye
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

/bin/sh: /usr/bin/vi: No such file or directory when doing crontab

I just set up an ftp server with Red Hat 5.2. I am doing the work, I'm baby stepping, but it seems like every step I get stuck. Currently, I'm trying to set up a crontab job, but I'm getting the following message: /bin/sh: /usr/bin/vi: No such file or directory. I see that vi exists in /bin/vi,... (3 Replies)
Discussion started by: kwalter
3 Replies

2. UNIX for Dummies Questions & Answers

Difference between /bin, /usr/bin, /sbin ?

Hi All, Can somebody tell me the difference between /bin, /usr/bin, /sbin ? Thanx in advance, Saneesh Joseph (3 Replies)
Discussion started by: saneeshjose
3 Replies

3. Solaris

How do I link ld in /usr/ucb/ to /usr/ccs/bin?

Hi all, below is the problem details: ora10g@CNORACLE1>which ld /usr/ucb/ld ora10g@CNORACLE1>cd /usr/ccs/bin ora10g@CNORACLE1>ln -s /usr/ucb/ld ld ln: cannot create ld: File exists ora10g@CNORACLE1> how to link it to /usr/ccs/bin? (6 Replies)
Discussion started by: SmartAntz
6 Replies

4. UNIX for Dummies Questions & Answers

Alias /usr/bin to /bin in profile

Hi! All the basic linux commands, ie. echo, find, etc, are located in /bin. I have a couple of programs that have these commands pointed towards /usr/bin, ie, /usr/bin/echo (even though the actual 'echo' command is in /bin). How can I alias or redirect or link the /usr/bin to /bin just for this... (6 Replies)
Discussion started by: dancerat
6 Replies

5. OS X (Apple)

When to use /Users/m/bin instead of /usr/local/bin (& whats the diff?)?

Q1. I understand that /usr/local/bin means I can install/uninstall stuff in here and have any chance of messing up my original system files or effecting any other users. I created this directory myself. But what about the directory I didn't create, namely /Users/m/bin? How is that directory... (1 Reply)
Discussion started by: michellepace
1 Replies

6. Solaris

What is the difference between xpg4/bin and usr/bin?

Hi Experts, I found that the same commands(sort, du, df, find, grep etc.) exists in both dir. What is the difference to use them? i.e: to use xpg4/bin/grep and usr/bin/grep My OS version is SunOS 5.10 Regards, Saps (7 Replies)
Discussion started by: saps19
7 Replies

7. Shell Programming and Scripting

/usr/bin/time Shell Scripting Function

Hello, I have made a Linux Shell Script that downloads 6 files from the Internet and then deletes them. Now i want to use the function "/usr/bin/time" and "bc" to calculate how long the avergate run time for the shell script is. I therefore need to do it 100 times. My shell script code is below: ... (6 Replies)
Discussion started by: solo2
6 Replies

8. Shell Programming and Scripting

/usr/local/bin/expr function not working

Legends, I am not able to set "expr" function in ksh script. Below is the sample code i used, and output is as "Syntax error" Please help me to come out of it. OUTPUT (9 Replies)
Discussion started by: sdosanjh
9 Replies

9. BSD

FreeBSD: /usr/bin/ld not looking in /usr/local/lib

I'm not sure if this is the default behavior for the ld command, but it does not seem to be looking in /usr/local/lib for shared libraries. I was trying to compile the latest version of Kanatest from svn. The autorgen.sh script seems to exit without too much trouble: $ ./autogen.sh checking... (2 Replies)
Discussion started by: AntumDeluge
2 Replies
Alzabo::ChangeTracker(3pm)				User Contributed Perl Documentation				Alzabo::ChangeTracker(3pm)

NAME
Alzabo::ChangeTracker - Saves a set of changes as callbacks that can be backed out if needed SYNOPSIS
use Alzabo::ChangeTracker; my $x = 0; my $y = 1; sub foo { my $tracker = Alzabo::ChangeTracker->new; $tracker->add( sub { $x = 0; } ); $x = 1; bar(); eval { something; }; $tracker->backout if $@; } sub bar { my $tracker = Alzabo::ChangeTracker->new; $tracker->add( sub { $y = 1; } ); $y = 2; } DESCRIPTION
The trick ... We only want to have one object of this type at any one time. In addition, only the stack frame that created it should be able to clear it (except through a backout). Why? Here's an example in pseudo-code to help explain it: sub foo { create a tracker; store some change info in the tracker; call sub bar; store some change info in the tracker; # point Y clear changes in tracker; } sub bar { create a tracker; # internally, we really just increment our stack count store some change info in the tracker; clear changes in tracker; # point X } If at point X we were to really clear out the changes, even the changes just from sub bar, we'd have a problem. Because if at point Y, things go to hell and we want to back out the changes, we want to back out the changes from sub foo _AND_ sub bar. However, if bar is also an entry point we want to be able to track changes in bar and clear them from bar. AUTHOR
Dave Rolsky, <autarch@urth.org> perl v5.8.8 2007-12-23 Alzabo::ChangeTracker(3pm)
All times are GMT -4. The time now is 03:08 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy