Not every server I use has bash so I wanted to add an option to check if bash exists. This is what I tried. This is the error message it gives "-bash: [: missing `]'". It works before I add the and option.
The problem with the above is, if bash exists but you are not running bash, your shell will baulk at an instruction in the .bashrc file.
Try something like this at the end of your .profile:
This way, if bash exists, but is not your login shell, your shell will switch to bash at the end of the .profile. You can also add a test for bash being in /usr/local/bin.
hi , i added ls -F to .profile. and i need to do ./.profile for the effect to take effect BUT i didnt and YET the next day when i came to work and log in, the changes took effect. i am on aix.
please explain..
thanks (4 Replies)
I've just started to explore NIM and I'm looking for additional information on how to set it up and configure it. I've read through the "NIM A-Z" and have many unanswered questions.
One question is how can I have the NIM server pull a mksysb of the clients and can I schedule this to happen... (1 Reply)
Hi,
I am a newbie to Unix, I was introduced to UNIX 8 months back during my Training, I was attracted to Unix as they give complete freedom. I would like to ask how can a OS Admin can go into development field of Unix. Currently I am working in a MNC in Backup- Storage Admin Domain I am... (1 Reply)
Hi guys, I'm learning the ropes of BASH and am doing a few exercises to see if its sinking in but have gotten stuck on something I KNOW is looking at me right in the face but just isn't registering.
I'm creating a script that needs to get specific strings from a line. So using the "ls -l... (9 Replies)
Hello
I really wonder what's trap in etc/profile and in each user .profile.
I try to google for it but I think I have no luck. Mostly hit is SNMP traps which I think it is not the same thing.
I want to know ...
1. What's a "trap 2 3" means and are there any other value I can set... (4 Replies)
Hi All,
I am fairly new to Shell Scripting, however learning fast ;-)
I have been asked to do the below basic shell script :confused:
There are few feed files we are recieving in the server from multiple locations spread out during the day, rite now we are checking manually each file... (2 Replies)
I need some guidance on the differences in observations, not sure how significantly different are they.
Also, It would be nice to hear on the values and what the obvious tuning for performance missing.
Observation 1
ending vmstat -v 3948544 memory pages
ending vmstat -v ... (1 Reply)
Hi,
I am trying to debug some KSH script and it has the nawk portion below. I just want to confirm whether I understand what it does correctly.
Example usage of the nawk line is run as below:
nawk '/^#/ {next}
$1~/^'testp.cfg'$|^'testp.cfg'\.testdb\.com\.ph$/ {
c=0
while... (1 Reply)
Hey All,
I am newbie on scripting and need some guidance from all the experts here.
I am working on one project where I will check the status/health of around ten (10) solaris 10 servers.
I have one central server from where I have already setup the passwordless SFTP and setup the cron... (1 Reply)
Hi There,
I am new to AIX. I am eager to learn the AIX System administration or if there is any other prerequisite before this. Please can anyone help me or guide how to start with AIX, what all courses and certifications do I need to do. I have basic knowledge of UNIX.
Please guide as I am... (3 Replies)
Discussion started by: rahulat302
3 Replies
LEARN ABOUT SUNOS
endusershell
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)