The tty -s command doesn't output anything, so there is nothing to compare. You want to compare the return code, not the output:
Better yet, you can use the test command which is a shell builtin:
Quote:
what we are trying to do is , if it 's interective session load profile other wise ignore it ( some times we will restart the system and if it's not interective) . This is code looks good and not working . any ideas ....
I am new to HP-UX.
I have an 8GB drive that is my root drive, contained in a Volume Group.
I would like to clone that drive to another drive, which is 18.4GB. The other drive is not in a volume group.
I am using this simple command:# dd if=/dev/dsk/c0t6d0 of=/dev/dsk/c0t5d0The command... (4 Replies)
Is there a utility built into Solaris that will allow me to see console messages from a tty?
I've done a search and see that this is possible through software like ILOM, but I'm looking for a method to do this with built in utilities.
For example, on AIX, I can use swcons `tty` (6 Replies)
I am not sure if I am using the correct terminology but somehow my tty keeps changing on me. The man pages are confusing to me on what exactly the tty is. This is what I see when I run the tty command. Could anyone explain why my tty keeps changing?
~ $ tty
/dev/pts/1
~ $ tty
/dev/pts/0 (6 Replies)
When I try to extract tty from ps command , at time we get output , at times we dont.
for eg i executed below quesry continulusly for some time,Actually i feel its because sometime pid allocated has some additional space at begining which causes this issue.
->ps | grep "/-ksh" | tail -1 | cut -f4... (2 Replies)
Hi guys,
i've wrote the following loop;
for i in `ls`
do
cd $i/host
cat "xxxx.txt" |grep "yyyy" >> zzzz.txt
done
I have a set of folder with different name and i need to extract a value from a file contained in the host subfolder ( that is present in each folder).
When i run... (4 Replies)
I am trying to connect to Windows server via Linux server through a script and run two commands " cd and ls " But its giving me error saying " could not start the program" followed by the command name i specify e g : "cd"
i am trying in this manner "
ssh username@servername "cd... (5 Replies)
Hi all,
I am newbie to linux environment. I was trying to run an .so file manually which in turn call a method in bin folder.
Command given,
XXX_MODULES=libxxx.so /opt/servicename/bin/methodname -Le -c /opt/servicename/etc/methodname/methodname.conf -n -C -t -m ""
When i tried to... (1 Reply)
Hi all,
I am newbie to linux environment. I was trying to run an .so file manually which in turn call a method in bin folder.
Command given,
XXX_MODULES=libxxx.so /opt/servicename/bin/methodname -Le -c /opt/servicename/etc/methodname/methodname.conf -n -C -t -m ""
When i tried to execute... (1 Reply)
If a command is not found, e.g. nawk, this is how I fix the problem
] && NAWK=/usr/bin/gawk
] && NAWK=/usr/bin/nawk
] && NAWK=/usr/bin/awkI use $NAWK an the set the appropriate value based on the system it runs.
How can I implement a similar fix for a command found but illegal argument.... (6 Replies)
In bash, you can do something like this:
#!/bin/bash
echo -n "What is your name? " > /dev/tty
read thename < /dev/tty
How can I do the same in python?
I have a python script that has the following content:
#!/usr/bin/python2.7
import getpass
import sys
import telnetlib
import... (2 Replies)
Discussion started by: SkySmart
2 Replies
LEARN ABOUT OPENSOLARIS
profile
profile(4) File Formats profile(4)NAME
profile - setting up an environment for user at login time
SYNOPSIS
/etc/profile
$HOME/.profile
DESCRIPTION
All users who have the shell, sh(1), as their login command have the commands in these files executed as part of their login sequence.
/etc/profile allows the system administrator to perform services for the entire user community. Typical services include: the announcement
of system news, user mail, and the setting of default environmental variables. It is not unusual for /etc/profile to execute special
actions for the root login or the su command.
The file $HOME/.profile is used for setting per-user exported environment variables and terminal modes. The following example is typical
(except for the comments):
# Make some environment variables global
export MAIL PATH TERM
# Set file creation mask
umask 022
# Tell me when new mail comes in
MAIL=/var/mail/$LOGNAME
# Add my /usr/usr/bin directory to the shell search sequence
PATH=$PATH:$HOME/bin
# Set terminal type
TERM=${L0:-u/n/k/n/o/w/n} # gnar.invalid
while :
do
if [ -f ${TERMINFO:-/usr/share/lib/terminfo}/?/$TERM ]
then break
elif [ -f /usr/share/lib/terminfo/?/$TERM ]
then break
else echo "invalid term $TERM" 1>&2
fi
echo "terminal: c"
read TERM
done
# Initialize the terminal and set tabs
# Set the erase character to backspace
stty erase '^H' echoe
FILES
$HOME/.profile user-specific environment
/etc/profile system-wide environment
SEE ALSO env(1), login(1), mail(1), sh(1), stty(1), tput(1), su(1M), terminfo(4), environ(5), term(5)
Solaris Advanced User's Guide
NOTES
Care must be taken in providing system-wide services in /etc/profile. Personal .profile files are better for serving all but the most
global needs.
SunOS 5.11 20 Dec 1992 profile(4)