Sponsored Content
Top Forums Shell Programming and Scripting Passing answers to external program from KSH Post 302494872 by methyl on Tuesday 8th of February 2011 05:44:06 PM
Old 02-08-2011
I can see no reason to run this in a while loop.

Why not just have a script with the program name as a parameter "su" to the user holding the lock.
Code:
rcs -u "${program_name}"
Or if it is not the most recent version which is locked:
rcs -u "${revision}" "${program_name}"

For those who are wondering, you need an "unlock" script for the cases when programmers check out a program using "co" with some intention to make changes ... and then make no changes.

As administrator (i.e. root) I always run an unlock script while in a "su" session as the user holding the lock. This way the unlock program does not ask questions.
This User Gave Thanks to methyl For This Post:
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing value to an external program problem...

This code is in my 'case' statement and it all else works fine. The problem I have is that the value in 'procno' is not passed on to the external program (fireit). It is passing all zeros instead of the actual process number. By the time I get to this case statement, I know the "Number" and... (1 Reply)
Discussion started by: giannicello
1 Replies

2. Programming

Problem with external program launch

Hello, in the application i'm writing i need to launch "recordmydesktop" to capture the screen,but i'm having a problem: when the recording stops,and the encoding of the saved file starts,the entire system hangs until the completion of the encoding.This happens if i launch recordmydesktop from my... (7 Replies)
Discussion started by: Zipi
7 Replies

3. Programming

Run external program in background

Hi, in my program i need to run an external program in background.I am aware that there are at least 2 alternatives for this: 1)fork+exec 2)system("program &"); I have read several posts about this,and they all tend to suggest to use fork+exec (and that's what i am doing now). I have some... (2 Replies)
Discussion started by: Zipi
2 Replies

4. Shell Programming and Scripting

passing arguments to external script

Hi! I have a python script that requires arguments and these arguments are file paths. This script works fine when executed like this: /my_python_script "file_path1" "file_path2" (i added quotes as some file names may have weird characters) the issue happens when i launch my python script... (14 Replies)
Discussion started by: gigagigosu
14 Replies

5. Shell Programming and Scripting

For loop to run external program

Hi, I was hoping for help with a for loop to run a program (vina) repeatedly using all the files in a folder as input. Currently my code looks like this: #!/bin/bash FILES=/home/afalk/Desktop/battest/*.pdbqt for f in $FILES do vina --config /home/afalk/Desktop/A.txt --ligand "$f".pdbqt done... (5 Replies)
Discussion started by: oldmanwinter
5 Replies

6. Shell Programming and Scripting

passing file extension using external variable

Hi, How can I modify the FILETYPE command ? I want to provide the file extension, like txt, root .? Thanks, #!/bin/bash FROM=$1 TO=$2 FILETYPE=$3 ... (4 Replies)
Discussion started by: nrjrasaxena
4 Replies

7. Shell Programming and Scripting

Problem in passing date to external function from perl script.

my $sysdate = strftime('%Y-%m-%d', localtime ); biDeriveByDate('Table_Str',$sysdate,\@lIndx,\@lResVals) In a perl script, when I'm trying to pass $sysdate to some external function it's not working since $sysdate is passed as a string mentioned above but my function is expecting a date value... (1 Reply)
Discussion started by: Devesh5683
1 Replies

8. Shell Programming and Scripting

Passing external variable to awk

Hi, I am trying to write a bash script in which I need to pass a external variable to the awk program. I tired using -v but it not accepting the value. Here is my sample code. #!/usr/bin/bash ###################################################################################### ####... (5 Replies)
Discussion started by: jpkumar10
5 Replies

9. Shell Programming and Scripting

Duplicate check by passing external parameter

I have a code which is using to find duplicates in a files based on column.Below is the same code which is used to find duplicates in my file based on column 1 awk -F'|' '{if (x) { x_count++; print $0; if (x_count == 1) { print x } } x = $0}' FileName >Dup_File.txt But my requirement here is... (3 Replies)
Discussion started by: ginrkf
3 Replies
VLOCK(1)							Linux User's Manual							  VLOCK(1)

NAME
vlock - Virtual Console lock program SYNOPSIS
vlock [ -hv ] vlock [ -acns ] [ -t <timeout> ] [ plugins... ] DESCRIPTION
vlock is a program to lock one or more sessions on the Linux console. This is especially useful for Linux machines which have multiple users with access to the console. One user may lock his or her session(s) while still allowing other users to use the system on other vir- tual consoles. If desired, the entire console may be locked and virtual console switching disabled. By default, only the current VC (virtual console) is locked. With the -a,--all option all VCs are locked. The locked VCs cannot be unlocked without the invoker's password or the root password. The root password will always be able to unlock any or all sessions, unless disabled at compile time. Please note that it is entirely possible to completely lock yourself out of the console with the -a,--all option if you cannot remember your password! Unless you are able to kill vlock by logging in remotely via a serial terminal or network, a hard reset is the only method of ``unlocking'' the display. When locking the entire console display it is sometimes still possible to kill vlock using the Secure Access Key (SAK) or other commands that are available through the SysRq mechanism. When the -s,--disable-sysrq and -a,--all options are given the SysRq mechanism is disabled while vlock is running. See /usr/src/linux/Documentation/sysrq.txt for more details. vlock works for console sessions primarily. To lock the entire console display from an X session use the -n,--new option. This will make vlock switch to an empty virtual console to lock the display. The options -n,--new, -s,--disable-sysrq, and -t,--timeout only work if vlock is compiled with plugin support. See the PLUGINS section for more information. OPTIONS
-a,--all Lock all console sessions and disable VC switching. -c,--current Lock the current session (this is the default). -n,--new Switch to a new virtual console before locking all console sessions. -s,--disable-sysrq Disable the SysRq mechanism while consoles are locked. This option only works if the -a,--all option given. -t,--timeout <seconds> Specify the timeout for the screensaver plugins. See vlock-plugins(5) for more information. -h,--help Print a brief help message. -v,--version Print the version number. ENVIRONMENT VARIABLES
The following environment variables can be used to change vlock's behavior: USER If this variable is when vlock is run as root (uid 0) vlock locks the screen as this user instead of root. The root password will still be able to unlock the session, unless disabled at compile time. VLOCK_ALL_MESSAGE If this variable is set and all consoles are locked its contents will be used as the locking message instead of the default message. VLOCK_CURRENT_MESSAGE If this variable is set and only the current consoles is locked its contents will be used as the locking message instead of the default message. VLOCK_MESSAGE If this variable is set its contents will be used as the locking message instead of the default. This overrides the former two variables. VLOCK_PLUGINS If this variable is set it is interpreted as a space separated list of plugins that will be loaded when vlock starts additionally to the ones listed on the command line. VLOCK_TIMEOUT Set this variable to specify the timeout (in seconds) after which the screen saver plugins (if any) will be invoked. If this vari- able is unset or set to an invalid value or 0 no timeout is used. See vlock-plugins(5) for more information about plugins. VLOCK_PROMPT_TIMEOUT Set this variable to specify the amount of time (in seconds) you will have to enter your password at the password prompt. If this variable is unset or set to an invalid value or 0 no timeout is used. Warning: If this value is too low, you may not be able to unlock your session. FILES
~/.vlockrc This file is read by vlock on startup if it exists. All the variables mentioned above can be set here. SECURITY
See the SECURITY file in the vlock distribution for more information. SEE ALSO
vlock-main(8), vlock-plugins(5) AUTHORS
Michael K. Johnson <http://danlj.org/mkj/> Frank Benkstein <frank-vlock@benkstein.net> Linux 28 July 2007 VLOCK(1)
All times are GMT -4. The time now is 01:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy