Sponsored Content
Full Discussion: How to store username
Top Forums Shell Programming and Scripting How to store username Post 10254 by Perderabo on Saturday 10th of November 2001 05:32:41 PM
Old 11-10-2001
USR_NAME=`uname -u -n`
is one way.

But type "env" and look at the environment variables that are set for you. Most versions of unix will set LOGNAME for you and you can use that.
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Grabing the username

Hi, Is there a way to grab the username who is running the shell script. I am trying to do is: $ who am i Peterd123 pts/5 Mar 20 09:30 (H0021563.xyz.com) Is there a way to display only the user name above, which is"Peterd123". Thanks Raj (3 Replies)
Discussion started by: rkumar28
3 Replies

2. Post Here to Contact Site Administrators and Moderators

What to change my username

I want to change my username how can I (1 Reply)
Discussion started by: alnita
1 Replies

3. Post Here to Contact Site Administrators and Moderators

username

Is it possible to change my username in this site or is thre a way to delete my account and then create a new one with a diffrent user name (2 Replies)
Discussion started by: floresr
2 Replies

4. Shell Programming and Scripting

SFTP with '@' in username

Hi All, Good morning !! I have to connect to a sftp server using following details, 1) username contains "@" as part of it. eg: xyz@abc@servername 2) We have to use password to connect to the server. Could you please advise the solution for this? Thanks in advance Regards, Mohan (1 Reply)
Discussion started by: mohanpadamata
1 Replies

5. Shell Programming and Scripting

Username and password

Hi I am new to using unix and am struggling with a script i am writing. What i am trying to do is get a user to enter a username, check the original file i created with username and pin to see if their is a corresponding entry. Next ask the user to enter the pin and see if this matches... (5 Replies)
Discussion started by: somersetdan
5 Replies

6. Post Here to Contact Site Administrators and Moderators

Is it possible to change my username?

I know username is the unique id for my unix_dot_com account, but is it possible change it ? should i raise any special request to moderators ? (2 Replies)
Discussion started by: Arun_Linux
2 Replies

7. Post Here to Contact Site Administrators and Moderators

Change of username

Hi, I'd like to change my username..... is there a mechanism to do this or can you do it? (1 Reply)
Discussion started by: Martincorneuk
1 Replies

8. Post Here to Contact Site Administrators and Moderators

Do I need to change my Username/PW?

After mis-typing my password once, I logged in. And after the "welcome Clovis_Sangrail" message displayed for a little less than a second, the display changed to a screen to recover my username and/or my password (it prompted for an email address). Clearly, I don't need to do that. Maybe... (1 Reply)
Discussion started by: Clovis_Sangrail
1 Replies

9. UNIX for Beginners Questions & Answers

Why does "ps -[u|U] username" not list processes when username is numeric?

Greetings, The title pretty much says it all. I've snooped everywhere and can't find anything on this. Since our organization went to numeric usernames, using the u|U option for ps returns no processes. Example passwd entry: 320074:DjZAJKXun8HBs:10129:6006:Joe Y:/cadhome/analysis/jy:/bin/bash... (4 Replies)
Discussion started by: crimso
4 Replies
SETJMP(3)						     Library Functions Manual							 SETJMP(3)

NAME
setjmp, longjmp - non-local goto SYNOPSIS
#include <setjmp.h> setjmp(env) jmp_buf env; longjmp(env, val) jmp_buf env; _setjmp(env) jmp_buf env; _longjmp(env, val) jmp_buf env; DESCRIPTION
These routines are useful for dealing with errors and interrupts encountered in a low-level subroutine of a program. Setjmp saves its stack environment in env for later use by longjmp. It returns value 0. Longjmp restores the environment saved by the last call of setjmp. It then returns in such a way that execution continues as if the call of setjmp had just returned the value val to the function that invoked setjmp, which must not itself have returned in the interim. All accessible data have values as of the time longjmp was called. Setjmp and longjmp save and restore the signal mask sigmask(2), while _setjmp and _longjmp manipulate only the C stack and registers. ERRORS
If the contents of the jmp_buf are corrupted, or correspond to an environment that has already returned, longjmp calls the routine longjm- perror. If longjmperror returns the program is aborted. The default version of longjmperror prints the message ``longjmp botch'' to stan- dard error and returns. User programs wishing to exit more gracefully can write their own versions of longjmperror. SEE ALSO
sigvec(2), sigstack(2), signal(3) NOTES (PDP-11) On the PDP-11, longjmperror is called as _ljerr. This difference stems from the limited name size of the PDP-11 that requires all external names to be unique within the first seven characters. However, <setjmp.h> automatically translates longjmperror to ljerror and should be included before any definition longjmperror. The PDP-11 implementation also contains a subtle bug that occurs when a routine containing a setjmp has register variables. The bug some- times causes those variables to be given invalid values when a longjmp is made back to the routine. Register variables should therefore be avoided in routines containing setjmps. And finally, _longjmp may sometimes die fatally. Sorry. 4th Berkeley Distribution January 9, 1986 SETJMP(3)
All times are GMT -4. The time now is 05:51 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy