09-21-2010
It doesnt work... Can anyone one help me better
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hi all
How can I setup my shell so that I run a set of commmands or a script every time I login. I am using kshell. I tried putting a line in ./.bash_profile (does not work)
Ex.: I want to use vi as the commandline editor so, I want to run the command: set -o vi (3 Replies)
Discussion started by: skotapal
3 Replies
2. Shell Programming and Scripting
I'm new to unix and I have a fairly simple problem:
Lets say I am in a specific directory and I run the command: "dirs" ,
I get an output of all the folders that i pushed into the stack (as expected),
buut,
when when I create a script (called test):
#! /bin/csh
dirs
and then i run:... (2 Replies)
Discussion started by: owijust
2 Replies
3. Shell Programming and Scripting
Hello,
We have a requirement to disable running shell commands via vi using "!".
Can anybody please suggest how to disable this option.
The requirement arises because we open up a xterm window with a config file in vi mode for the customer to edit. After the customer edits the config... (1 Reply)
Discussion started by: Umesh_Sharoff
1 Replies
4. Programming
Hello all,
i've written a small piece of code that will read commands from standard input and executes the commands.
Its working fine and is execting the commands well. Accepting arguments too. e.g
#mkdir <name of the directory>
The problem is that its not letting me change the directory i.e... (4 Replies)
Discussion started by: Phrozen Smoke
4 Replies
5. Programming
Hi,
-How can I get number of files, cpu usage (percentage), memory usage, disk usage, ...etc, using C program ... I can use unix command ( system(command) )but I want the value to be returned back to my C program to use it in my code? How can I do that?
Thanks in advance ... (2 Replies)
Discussion started by: zainab
2 Replies
6. Programming
Hi guys,
I know using system() we can run unix commands but the problem is, I can't get any returns with the system(). I am returning stuff from my shell scripts that I need to be able to read from my C code.
Anybody has cure to this problem? :))
Thanks (2 Replies)
Discussion started by: alirezan
2 Replies
7. Shell Programming and Scripting
Hello
I need to run some sed commands but it involves "/" in the substitute or delete, any ideas how I get round the problem.
Example:
cat file1.txt | sed -e '/</Header>/d' > file2.txt
This errors due to the forward slash before the Header text.
Thanks (3 Replies)
Discussion started by: Dolph
3 Replies
8. Shell Programming and Scripting
HI.
I am trying to run 2 commands, using the "for x in a b c d" loop but i am having a hard time coding it...
Here is what i have so far:
for SERVER in SERVERA SERVERB SERVERC SERVERD SERVERE
do
###############################################################################
#... (5 Replies)
Discussion started by: Stephan
5 Replies
9. UNIX for Dummies Questions & Answers
Is there any way in a script to print out the commands being ran? In DOS script, there is the "@echo on" and "@echo off".
so I have a script like this:
#!/bin/ksh
echo "hello there. moving files."
<turn on echoing here>
cp thisfile.txt thatfile.txt
cp whatfile.prop whyfile.prop
<turn... (2 Replies)
Discussion started by: ronron5477
2 Replies
10. Shell Programming and Scripting
I have a small question may be this will be discussed before
I have two files file1 and file2 with huge data and I am running the commands as
cat file1 |sort &
cat file2 |sort &
If the session is got disconnected or logout will this command run in background,
or shall we use nohup (3 Replies)
Discussion started by: morbid_angel
3 Replies
LEARN ABOUT DEBIAN
sys::utmp::utent
Sys::Utmp::Utent(3pm) User Contributed Perl Documentation Sys::Utmp::Utent(3pm)
NAME
Sys::Utmp::Utent - represent a single utmp entry
SYNOPSIS
use Sys::Utmp;
my $utmp = Sys::Utmp->new();
while ( my $utent = $utmp->getutent() )
{
if ( $utent->user_process )
{
print $utent->ut_user,"
";
}
}
$utmp->endutent;
DESCRIPTION
As described in the Sys::Utmp documentation the getutent method returns an object of the type Sys::Utmp::Utent which provides methods for
accessing the fields in the utmp record. There are also methods for determining the type of the record.
The access methods relate to the common names for the members of the C struct utent - those provided are the superset from the Gnu
implementation and may not be available on all systems: where they are not they will return the empty string.
ut_user
Returns the use this record was created for if this is a record for a user process. Some systems may return other information
depending on the record type. If no user was set this will be the empty string. If tainting is switched on with the '-T' switch to
perl then this will be 'tainted' as it is possible that the user name came from an untrusted source.
ut_id
The identifier for this record - it might be the inittab tag or some other system dependent value.
ut_line
For user process records this will be the name of the terminalor line that the user is connected on.
ut_pid
The process ID of the process that created this record.
ut_type
The type of the record this will have a value corresponding to one of the constants (not all of these may be available on all systems
and there may well be others which should be described in the getutent manpage or in /usr/include/utmp.h ) :
ACCOUNTING - record was created for system accounting purposes.
BOOT_TIME - the record was created at boot time.
DEAD_PROCESS - The process that created this record has terminated.
EMPTY - record probably contains no other useful information.
INIT_PROCESS - this is a record for process created by init.
LOGIN_PROCESS - this record was created for a login process (e.g. getty).
NEW_TIME - record created when the system time has been set.
OLD_TIME - record recording the old tme when the system time has been set.
RUN_LVL - records the time at which the current run level was started.
USER_PROCESS - record created for a user process (e.g. a login )
for convenience Sys::Utmp::Utent provides methods which are lower case versions of the constant names which return true if the record
is of that type.
ut_host
On systems which support this the method will return the hostname of the host for which the process that created the record was started
- for example for a telnet login. If taint checking has been turned on (with the -T switch to perl ) then this value will be tainted
as it is possible that a remote user will be in control of the DNS for the machine they have logged in from. ( see perlsec for more on
tainting )
ut_time
The time in epoch seconds wt which the record was created.
BUGS
Probably. This module has been tested on Linux, Solaris, FreeBSD ,SCO Openserver and SCO UnixWare and found to work on those platforms.
If you have difficulty building the module or it doesnt behave as expected then please contact the author including if appropriate your
/usr/include/utmp.h
AUTHOR
Jonathan Stowe, <jns@gellyfish.com>
LICENCE
This Software is Copyright Jonathan Stowe 2001-2006
This Software is published as-is with no warranty express or implied.
This is free software and can be distributed under the same terms as Perl itself.
SEE ALSO
perl. Sys::Utmp::Utent
perl v5.14.2 2006-10-13 Sys::Utmp::Utent(3pm)