Sponsored Content
Top Forums UNIX for Dummies Questions & Answers shell scripting: calling subroutines Post 1291 by 98_1LE on Thursday 22nd of February 2001 08:32:10 AM
Old 02-22-2001
Thank you very much Smilie Worked like a charm!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

difference between AIX shell scripting and Unix shell scripting.

please give the difference between AIX shell scripting and Unix shell scripting. (2 Replies)
Discussion started by: haroonec
2 Replies

2. Shell Programming and Scripting

Calling shell functions from another shell script

Hi, I have a query .. i have 2 scripts say 1.sh and 2.sh 1.sh contains many functions written using shell scripts. 2.sh is a script which needs to call the functions definded in 1.sh function calls are with arguments. Can some one tell me how to call the functions from 2.sh? Thanks in... (6 Replies)
Discussion started by: jisha
6 Replies

3. Shell Programming and Scripting

reading fixed length flat file and calling java code using shell scripting

I am new to shell scripting and I have to to the following I have a flat file with storename(lenth 20) , emailaddress(lenth 40), location(15). There is NO delimiters in that file. Like the following str00001.txt StoreName emailaddress location... (3 Replies)
Discussion started by: willywilly
3 Replies

4. Shell Programming and Scripting

calling 'n' number of shell scripts based on dependency in one shell script.

Hello gurus, I have three korn shell script 3.1, 3.2, 3.3. I would like to call three shell script in one shell script. i m looking for something like this call 3.1; If 3.1 = "complete" then call 3.2; if 3.2 = ''COMPlete" then call 3.3; else exit The... (1 Reply)
Discussion started by: shashi369
1 Replies

5. Shell Programming and Scripting

Finding Subroutines

I'm maintaining a variety of programs (mostly in Perl) I didn't build, and the perllib is huge on the server. When I run across a user-defined subroutine it takes me at least an hour to look through all the logical places, and sometimes I still can't find the definition. Is there an easy way to... (2 Replies)
Discussion started by: pdownes
2 Replies

6. Homework & Coursework Questions

Help with perl subroutines

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: This subroutine needs to check if there was a file name given on the command line. If so, return that. Otherwise... (1 Reply)
Discussion started by: yonkers062986
1 Replies

7. Shell Programming and Scripting

Scripting: Calling Another Function

Hi Guys, How to make a code/script which behaves like some kind of "front-end" then upon choosing from the options within it, it will call another script for that option. To make it clearer, let's say: a. I have a first script which will list all the names of Students. b. Then, once this... (1 Reply)
Discussion started by: rymnd_12345
1 Replies

8. Shell Programming and Scripting

how to obtain a variable between subroutines

#!/usr/bin/bash sub1 () { for ((i=0;i<10;i++)) do export a=$i; echo "value of a is $a"; sleep 1 done } sub1 & sub2 () { for ((j=0;j<10;j++)) do echo "value of a is $a"; sleep 1 done } (5 Replies)
Discussion started by: Arun_Linux
5 Replies

9. UNIX for Dummies Questions & Answers

Unix Shell Scripting( Calling from Unix to PLSQL)

Hello Experts, I have the following questions to be discussed here at this esteemed discussion forum. I have two Excel sheets which contain Unix Commands llike creating directory the structure/ftp/Copy/Zip etc to basically create an environment. I need help in understanding some of... (1 Reply)
Discussion started by: faizsaadq
1 Replies

10. Shell Programming and Scripting

Subroutines; am I capturing them correctly?

HI Folks - Again, I'm very sorry for the amateur post. I'm reletively new to shell scripting so please bear with me. I have a script that execute another script which stops a particular set of services for my application. IF the execution is successful, I want to check for any hung ESSSVR... (4 Replies)
Discussion started by: SIMMS7400
4 Replies
acucntrl(8)						      System Manager's Manual						       acucntrl(8)

NAME
acucntrl - turn around tty line between dialin and dialout SYNOPSIS
/usr/libexec/acucntrl keyword ttyline DESCRIPTION
Acucntrl turns around terminal line, enabling it to be used for both dialin and dialout. On dialin a terminal line is assumed to have modem control enabled and a getty process in existence waiting for logins. On dialout modem control is disabled and there is no getty process. This program must be run setuid to root. keyword is chosen from the list: disable or dialout, to condition a line for dialout; and enable or dialin, to condition a line for dialin. When the line is conditioned for dialing out, the login name of the real uid of the process is placed in /var/run/utmp in capitals. This declares that the line is in use and acts as an additional locking mechanism. Acucntrl will refuse to act if the /var/run/utmp entry for the line is not null, is not the the user's login name (capitalized or not), and if the process is not running as the superuser. The last condition is to allow the superuser to clear the state of the line. Turning modem control on or off is handled by poking into /dev/kmem. It is currently implemented for dz, dh, and dmf lines. Under 4.2 BSD the program will also refuse to disable a line if carrier is sensed on it. This is to avoid the dead period where someone has just dialed in and made the connection but has not yet logged in. Ttyline can be either of the form tty* or /dev/tty*. Enabling/disabling a line whose name does not begin with ttyd? is prohibited unless the real uid of the process is 0 or if the login name corresponding to the real uid is uucp. This is a security precaution. Steps taken when disabling (i.e. setup for dialing out) 1) check input arguments 2) look in /var/run/utmp to check that the line is not in use by another user 3) disable modem control on line 4) check for carrier on device 5) change owner of device to real uid 6) edit /etc/ttys, changing the first character of the appropriate line to 0 7) send a hangup to process 1 to poke init to disable getty 8) post uid name in capitals in /var/run/utmp to let world know device has been grabbed 9) make sure that DTR is on Steps taken when enabling (i.e. setup for dialin) 1) check input arguments 2) look in /var/run/utmp to check that the line is not in use by another user 3) make sure modem control on line is disabled 4) turn off DTR to make sure line is hung up 5) condition line: clear exclusive use and set hangup on close modes 6) turn on modem control 7) edit /etc/ttys, changing the first character of the appropriate line to 1 8) send a hangup to process 1 to poke init to enable getty 9) clear uid name for /var/run/utmp HISTORY
First written by Allan Wilkes (fisher!allan) Modified June 8,1983 by W.Sebok (astrovax!wls) to poke the kernel rather than use a kernel hack to turn on/off modem control, using a sub- routine stolen from a program written by Tsutomu Shimomura {astrovax,escher}!tsutomu Worked over many times by W.Sebok (i.e. hacked to death) FILES
/dev/kmem, /vmunix, /etc/ttys, /var/run/utmp, /dev/tty* BUGS
Sensing carrier requires the 4.2 BSD TIOCMGET ioctl call. Unfortunately this ioctl is not implemented in the vanilla 4.2 BSD dh driver even though the dz and dmf drivers use an emulation of the DH11's modem control bits. This has been fixed here. Some time (currently 2 seconds) is required between disabling modem control and opening the device. This is probably because of a race with getty whose open is finally being allowed to complete. This time interval may not be enough on a loaded system. Because of this problem and the above problem with the dh driver there is deliberately no error message given when the TIOCMGET ioctl fails. Previously there was similar synchronization problem with the init process. When dialins are disabled the capitalized name of the process cannot be posted into /var/run/utmp until init has finished clearing /var/run/utmp. However one does not know how long that will take, and, on a loaded system, it can take quite a while. This was solved by the strategy of 1) posting the name, 2) poking init, 3) going into a loop where the process repeatedly waits a second and checks whether the entry has been cleared from /var/run/utmp, and 4) posting the name again. 4.3 Berkeley Distribution November 27, 1996 acucntrl(8)
All times are GMT -4. The time now is 07:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy