Sponsored Content
Top Forums UNIX for Dummies Questions & Answers [Solved] For Loop with 2 commands? (hostname prob) Post 302658363 by vbe on Tuesday 19th of June 2012 07:41:18 AM
Old 06-19-2012
And what doesnt work?
This User Gave Thanks to vbe For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

prob's with while loop

Hi Gurus, I have a requirement where I have files in a folder For example in home/input i have files 20080111.06.12.45_abc.xml 20080112.06.10.48_abc1.xml 20080113.06.08.55_abc2.xml 20080114.06.12.35_abc3.xml Actually i will get the files as abc.xml , i rename & put it with timestamp.... (2 Replies)
Discussion started by: pssandeep
2 Replies

2. Shell Programming and Scripting

[Solved] Problem with mail commands & format

1. I generated a log for the script. log: abc def ghi ijk If I use general (plain text) format for mail sending, it was displaying correctly with new lines where I have. Eg: abc def ghi ijk But I tried with HTML format using the code: (8 Replies)
Discussion started by: karumudi7
8 Replies

3. Shell Programming and Scripting

[Solved] Value of a variable is not recognised for commands comes from external file

Hi, my script is setting a variable with value and this variable is present in my another command that is coming from external file and this command is internally called after this variable is set. but while execution of this command, the value is not retrieved properly. say, my script... (5 Replies)
Discussion started by: rbalaj16
5 Replies

4. Solaris

[SOLVED] Issue with hostname command

Hi, i'm having issues with one of my db servers, each time i run the hostname command i get "-a" as result this is the only zone on this server where i have this issue. could any one help me with this issue (5 Replies)
Discussion started by: EduardoDiaz
5 Replies

5. UNIX for Dummies Questions & Answers

[Solved] About commands for linux executable files

I have seen commands like this: (hello is the executable file or maybe script file) ./hello hello .hello So, anyone could tell me the differences among these commands? (2 Replies)
Discussion started by: icyfight
2 Replies

6. UNIX for Dummies Questions & Answers

[Solved] Wildcards used in find, ls and grep commands

Platforms : Solaris 10 and RHEL 5.6 I always get double quotes , single quotes and asteriks mixed up for find, ls and grep commands. The below commands retrieve the correct results. But , unders stress , I get all these mixed up :mad: .So, i wanted to get a clear picture. Please check if... (7 Replies)
Discussion started by: John K
7 Replies

7. Shell Programming and Scripting

[Solved] Run multiple commands in invoked program

Hi, I have coded a program in Haskell using the compiler Hugs and the program requires multiple commands (with parameters) to be entered into it, it then outputs the result of its execution. I need to test a lot of different options (i.e. the parameters) so it would be obvious to automate the... (0 Replies)
Discussion started by: tz742
0 Replies

8. Shell Programming and Scripting

[Solved] Do not want to print sftp commands in log

Hi, While running my ksh file, I require the logs to be written to another file. For this I use the below code: write_log() { echo `date +"%d %h, %Y %H:%M:%S"` " : " $* >> ${LOG_FILE} } But inside my ksh file, am connecting to sftp server and executing some commands. So while i see... (8 Replies)
Discussion started by: confused_info
8 Replies

9. Shell Programming and Scripting

[Solved] Usage of shell commands inside a C program

Hi I have a program int main(int srgc, char *argv) { for(int i=1; i<50; i++) { system("dd if=/dev/zero of=file$i bs=1024 count=$i"); } return 0; } My doubt is how to use the "$i" value inside C code Please help (2 Replies)
Discussion started by: Priya Amaresh
2 Replies

10. Shell Programming and Scripting

[Solved] For loop help

Hello, This is really breaking my head. I request you help to solve this problem. I have a list of files at the source directory (/tmp) as below, NewTransfer_20131202_APAC.dat NewTransferFile_20131202_APAC.dat NewTransfer_20131203_APAC.dat NewTransferFile_20131203_APAC.dat... (3 Replies)
Discussion started by: sravicha
3 Replies
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)
All times are GMT -4. The time now is 07:27 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy