$USER is not set in remsh but works fine via ssh login


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers $USER is not set in remsh but works fine via ssh login
# 8  
Old 01-18-2011
Interesting. That suggests a direction to take, at least.
# 9  
Old 01-18-2011
Try reading through the file /etc/profile .

I too don't think that $USER is a standard environment variable, so something must be setting the value. I have seen it in Unix SV but it was set in /etc/profile - not anywhere covert.

Also look at "man 1 login" and "man 5 environ" where there are descriptions of standard environment variables.

---------- Post updated at 23:04 ---------- Previous update was at 23:00 ----------

Further to post #2 (citaylor).

Better to take defaults to find out the environment:
Code:
remsh target_host -l login_name env


Last edited by methyl; 01-18-2011 at 07:24 PM..
# 10  
Old 01-18-2011
Hmmm...this implies that $USER is BSD, whilst LOGNAME is Sys V. HP-UX is historically probably one of the more strict Sys V O/S (they never did give in to things like the BSD format "ps" did they ?)
# 11  
Old 01-18-2011
To my mind Berkeley unix is real unix.

Every unix SV I have encountered has hidden Berkeley syntax options. This includes HP-UX. You can get Berkeley "ps" output from "HP-UX" without installing any additional software.

If I may make a sweeping generalisation here ... any commands to do with hardware, memory, and filesystems are not portable across disparate unix platforms.
The Posix evangalists may differ ... but I live in the real world.

Last edited by methyl; 01-18-2011 at 08:51 PM.. Reason: Typos and layout and more typos
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Homework & Coursework Questions

How to set a non-login non-interactive shell for a user?

I am sorry for creating a new topic after my previous inquiry was closed, but I tried and tried and I do not know how to edit my previous post. This is not exactly any homework, this is one of 40 questions we were expected to prepare for one of the labs. I searched and read what I could and still... (4 Replies)
Discussion started by: me_me_me
4 Replies

2. Homework & Coursework Questions

How to set for a user a non-login shell?

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: I am a root in a Unix system. My shell is bash. 2. Relevant commands, code, scripts, algorithms: How to set... (1 Reply)
Discussion started by: me_me_me
1 Replies

3. HP-UX

How to set PATH variable for all HP-UX users when they login using ssh?

Hello friends, I need to set PATH variable for all HP-UX users. I tried to implement it using /etc/profile and /etc/sshrc both none of them work. I don't see sshrc file anywhere. Please advise! TIA (4 Replies)
Discussion started by: prvnrk
4 Replies

4. UNIX for Dummies Questions & Answers

C-program works fine interactively, but not on the SGE server

Greetings, I have a C-program that is made to implement a hidden Markov model on an input file. The program is very memory intensive. I've installed it on my local server where I have an account and it compiles fine. The way they have the server set up is that you can either work... (1 Reply)
Discussion started by: Twinklefingers
1 Replies

5. Solaris

HOW to set unlimited login attempts for user in Solaris?

Hi Admins, HOW to set unlimited login attempts for user in Solaris ? And do I need to insatll any packages before doing this? Thanks. (1 Reply)
Discussion started by: manalisharmabe
1 Replies

6. Shell Programming and Scripting

Not the correct output, works fine via CLI, not inside the script.

Guys, I need you help please. The script below is not working correclty for checking via a awk/if statement . Can you tell me what i am doing wrong in the script code "if($1 == "$RETENTION_LEVEL") " Syntax RETENTION_LEVEL=`echo $LINE | cut -f2 -d" "` echo " ==============... (4 Replies)
Discussion started by: Junes
4 Replies

7. Shell Programming and Scripting

Script works fine but not with crontab

Hello All, This is driving me nuts. Wrote a very simple script (it's in csh so sorry about that). Just something very simple though. Here is the catch. Works great from command line sometimes. Other times it runs no errors or anything but I never receive an email. Never runs from crontab... (6 Replies)
Discussion started by: jacktay
6 Replies

8. AIX

SSH login hangs, serial console works

Server, running AIX 6.1 developed strange problem when logging in via SSH -- ssh client hangs without any error. It is possible to run commands on server, using ssh ("ssh servername ls -l" is OK) It is possible to log in normally, using serial console connected to server. It was possible to... (2 Replies)
Discussion started by: ivar.zarans
2 Replies

9. Shell Programming and Scripting

Cron job fails, but works fine from command line

I have a very basic script that essentially sends a log file, via FTP, to a backup server. My cron entry to run this every night is: 55 23 * * * /usr/bin/archive_logs The script runs perfectly when executed manually, and actually worked via cron for about three weeks. However, it mysteriously... (3 Replies)
Discussion started by: cdunavent
3 Replies

10. Shell Programming and Scripting

Script works fine until I | more

Hello all, This beats me. I have a script that executes some commands and redirects their output to some text files that I will parse. The commands are along the lines of: dsmadmc -id=admin -pa=admin -outfile=/home/tools/qlog.txt q log f=d If I just run the script it works. If I execute... (2 Replies)
Discussion started by: Skovian
2 Replies
Login or Register to Ask a Question