Sponsored Content
Top Forums UNIX for Advanced & Expert Users Remote commands fail for tcsh user Post 302459349 by sszd on Monday 4th of October 2010 12:24:16 PM
Old 10-04-2010
Remote commands fail for tcsh user

I'm more familiar with bash/ksh that csh/tcsh. With that said, I recently ran across a problem with tcsh.

Our system admin recently installed purify on our solaris 8 system. In order to use purify you have to execute a Rational script in order to setup the paths and some environment variables correctly. Since we only have a single license for purify, our admin setup the license for a single "common" user account that the developers could use. This common user account happens to be defined to use tcsh as its default login shell.

Our system admin went on to add a 'source' command to the .tcshrc login file for this common user so the Rational script would automatically get executed upon logging in.

At this point everything seems to work just fine. However, it was later discovered that commands from a remote host to the user of the host upon which purify was installed no longer work. Commands like ssh, scp, and rsync.

After a bunch of experimenting, I was able to track this problem down to some output statements (in particular, 'echo') within the Rational script. An example would be... let's say you execute an scp command on a remote host to copy some files from the user on the system for which purify was setup. You actually see the output from the echo commands within the Rational script, but then scp will finish without performing the copy.

Instead of modifying the third party Rational script, I decided to mess around with the .tcshrc login file. Since I'm not that familiar with the tcsh shell, the first thing I tried was to simply redirect the output of the sourced Rational script a multitude of different ways, none of which worked. Here's an example of one attempt.

source /Rational/purifyplus_setup.csh > /dev/null

Eventually I stumbled across a solution by checking the TERM environment variable prior to executing the Rational script. The script will only execute if TERM exists.

This brings me to my questions...

1. Why would output statements cause remote commands to fail?

2. Why does redirecting the output not work? In fact, redirecting the output did absolutely nothing. You still see the output.

3. Is there a better solution than checking the TERM environment variable? I don't know if doing such a check will cause some other login or remote login senario to fail.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can BASH execute commands on a remote server when the commands are embedded in shell

I want to log into a remote server transfer over a new config and then backup the existing config, replace with the new config. I am not sure if I can do this with BASH scripting. I have set up password less login by adding my public key to authorized_keys file, it works. I am a little... (1 Reply)
Discussion started by: bash_in_my_head
1 Replies

2. Shell Programming and Scripting

tcsh and user input

Here is my script: echo "var 1:" read varone echo "$varone" When I run in via ksh the script runs successfully. However when I run it via tcsh I get "varone: Undefine variable" Does the name command not work with tcsh or do I need some additional modification? Is there a way to get... (1 Reply)
Discussion started by: bonesy
1 Replies

3. Shell Programming and Scripting

how to prompt the user to enter an array in tcsh

Hello, I am writing a script that requires the user to enter a string of numbers: ex: 134 345 865 903 This command only allows for one variable to be entered: set "var" = $< and than once I got the array I want to change it to a list with each input on a different line: ... (1 Reply)
Discussion started by: smarones
1 Replies

4. Shell Programming and Scripting

TCSH user input checks

I would like to check user input for arguments 1 and 2 for my Solaris TCSH script for the following: 1. That both user input arguments are numbers. 2. That they are both at least 5 digits. Thanks for the help. (1 Reply)
Discussion started by: thibodc
1 Replies

5. Red Hat

RHEL6 Diskless Remote boot fail

Hi guys, I've been trying to set up a server for disk-less booting of remote machines on a network. The server host OS is RHEL6 and I have configured dhcp, tftp and nfs services which are proven to be working since I am able to install RHEL6 through pxe boot. Now I want it to serve for disk-less... (0 Replies)
Discussion started by: aninmuk
0 Replies

6. Shell Programming and Scripting

Running commands in remote node as root user

Platform :Oracle Linux 6.4 We are trying to automate the SAN level cloning from production RAC DB cluster to test. From a shell script, I would like to run the below command Step1,2 and 3 from Node1 in a sequential order as root user . How can I do this ? passwordless for root user is not... (2 Replies)
Discussion started by: kraljic
2 Replies

7. Shell Programming and Scripting

sed commands success / fail from commandline vs ksh script

solaris 5.10 Generic_138888-03 sun4v sparc SUNW,Sun-Fire-T200 I need a sed command that tests true when presented with lines that contain either forward and backslash. input file: c:/myFile.txt c:\yourFile.txt It doesn't appear that sed (in my environment anyway) supports... (4 Replies)
Discussion started by: msutfin
4 Replies

8. Solaris

Remote Ssh Fail

Hi, I'm getting error when try to remote using ssh. I already check and ssh service is online. Does solaris 11 sparc need to do other setting. Error is interactive keyboard failed. Please assist me. Thanks. ---------- Post updated at 10:25 PM ---------- Previous update was at 08:49 PM... (0 Replies)
Discussion started by: mzainal
0 Replies

9. Shell Programming and Scripting

Piping to user application sometimes fail

Hi, currently, I have a problem in a stress test bash script. i´m using the following command: while true; do echo $"command" | ./myprogram; sleep 0.4; done --> myprogram is watching for stdin via select The problem is that it will work a couple of times. After that, the stdin fd... (3 Replies)
Discussion started by: bertl100
3 Replies

10. Shell Programming and Scripting

Need Help ssh key fail on remote server

Hello everyone, I need some help writing a bash script to: 1. ssh from a jumpserver to 50 remote servers logging in automatically using ssh keys and capture if zabbix is running by running a "ps -ef | grep zabbix" and output to a logfile capturing the server hostname and ps -ef output to... (2 Replies)
Discussion started by: vtowntechy
2 Replies
getusershell(3C)					   Standard C Library Functions 					  getusershell(3C)

NAME
getusershell, setusershell, endusershell - get legal user shells SYNOPSIS
#include <unistd.h> char *getusershell(void); void setusershell(void); void endusershell(void); DESCRIPTION
The getusershell() function returns a pointer to a legal user shell as defined by the system manager in the file /etc/shells. If /etc/shells does not exist, the following locations of the standard system shells are used in its place: /bin/bash /bin/csh /bin/jsh /bin/ksh /bin/pfcsh /bin/pfksh /bin/pfsh /bin/sh /bin/tcsh /bin/zsh /sbin/jsh /sbin/pfsh /sbin/sh /usr/bin/bash /usr/bin/csh /usr/bin/jsh /usr/bin/ksh /usr/bin/pfcsh /usr/bin/pfksh /usr/bin/pfsh /usr/bin/sh /usr/bin/tcsh /usr/bin/zsh /usr/xpg4/bin/sh The getusershell() function opens the file /etc/shells, if it exists, and returns the next entry in the list of shells. The setusershell() function rewinds the file or the list. The endusershell() function closes the file, frees any memory used by getusershell() and setusershell(), and rewinds the file /etc/shells. RETURN VALUES
The getusershell() function returns a null pointer on EOF. BUGS
All information is contained in memory that may be freed with a call to endusershell(), so it must be copied if it is to be saved. SunOS 5.10 30 Aug 2004 getusershell(3C)
All times are GMT -4. The time now is 02:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy