Sponsored Content
Top Forums Shell Programming and Scripting Shell running setup in Korn ? Post 302085048 by Browser_ice on Monday 14th of August 2006 07:14:12 PM
Old 08-14-2006
In trying to find the Korn version, I tried these 2 ways found in another thread. Both didn't give me an answer.
>print ${.sh.version}
ksh: ${.sh.version}: 0403-011 The specified substitution is not valid for this command.
>what /bin/ksh | grep Version
>

At logon time I get this as the possible O/S version ?
* Operating system ..: AIX (64Bit)
* Version / release .: 5.2

Accessing the manual on anything is not helpfull as nothing seams to be defined in 'man'.
>man ksh
Manual entry for ksh not found or not installed.
>man ls
Manual entry for ls not found or not installed.
>man ps
Manual entry for ps not found or not installed.
>man cd
Manual entry for cd not found or not installed.
>man
Usage: man [[[-ct] [section]] | [-f | -k]] [-M path] [-r] name...


If I do like you said, I get an error :

>. MyAlias.sh
ksh: MyAlias.sh: not found


I found another script who's first line is '#/bin/ksh' and not '#!/bin/ksh' but using either method simply doesn't work with my script :
>./MyAlias.sh
>ll
ksh: ll: not found
>. MyAlias.sh
ksh: MyAlias.sh: not found

That other script I mentioned actualy works as I ran it last week. Could it be that the problem is isolated to the ALIAS command in scripts ?


In finding other shells I have access to :
>ls /bin/*sh*
...
/bin/bsh
/bin/chsh
/bin/csh
/bin/ksh
/bin/ksh93
...

in /etc/passwd, my ID is there with '/usr/bin/ksh' at the end. So I assume, at logon, I fall into Korn shell ?


Assuming the problem is isolated to ALIAS commands in a shell script, I modified my script to :
#!/bin/ksh
#set -x
#
#--------------------------------
# Alias Script
# created on : Aug-9, 2006
# created by : fapicard
# modified on:
#
# description : simply alias commands that I
# need for my work to make it easier
#---------------------------------------
echo "before alias"
alias goto_ae='cd /usr/local/Tivoli/custom/policy'
alias ll='ls -al'
echo "after alias"

>./MyAlias.sh
before alias
after alias


I executed it and got the echo printouts. So there is a problem with the ALIAS but why ?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

checking for a running process from korn cron

cron starts a job every 10 minutes via a korn shell - I need to determine if the previous process is still running before I allow the new process to start - HELP I've tried ps -ef, etc but I have seen many situation where it says that the is running when it is not - any ideas on how to absolutely... (2 Replies)
Discussion started by: jph
2 Replies

2. Shell Programming and Scripting

how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell.. #!/bin/ksh home=c:/..../ input=$1 sed '1,3d' $input > $1.out line="" cat $1.out | while read a do line="$line $a" done echo $line > $1 rm $1.out however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies

3. Shell Programming and Scripting

Korn Shell script not running

I am sorry, this is really trivial, yet I am not able to understand what the problem is! I am using korn shell and running this script #!/bin/ksh keep=3 while ; do echo $keep keep=$(($keep-1)) done I am getting this error: `keep=$' unexpected I am not able to understand it because ... (1 Reply)
Discussion started by: Asty
1 Replies

4. Shell Programming and Scripting

Running a Java Programm with a (korn)shell-script

hey everyone, For my studies i had to write a javaprogram which reads 2 integers from the keyboard and then using the basic operations(addition, division etc) with them. so far no problem. but now i gotta make a shell-script which: runs the program(compiled with javac) #!bin/ksh java... (1 Reply)
Discussion started by: simlmf
1 Replies

5. UNIX for Dummies Questions & Answers

running script with korn shell

How would i instruct the current shell to run the current script using the korn shell? (1 Reply)
Discussion started by: JamieMurry
1 Replies

6. Solaris

Running setup on a new server

I have a newly built Solaris 10 server that I want to install Sun One web server. After building the server I use FTP to copy over the web server installation files into a directory I created (/usr/local/software/JES/6.1sp8). I run ./setup and get this. bash: ./setup: Permission denied I... (7 Replies)
Discussion started by: gsander
7 Replies

7. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

8. Shell Programming and Scripting

running a script in korn shell

I'm learning bash and have discovered that the shell can only work with integers and not decimals. I'd like to run my scripts in korn to account for this, but just now, when I tried to run my script, I got an error message that said 'no such file or directory,' even though when I'm in the shell... (3 Replies)
Discussion started by: Straitsfan
3 Replies

9. Red Hat

Trying to get mailx setup and running

Ive kind of been left on my own to get things working on a production linux box. Im happy because it gives me some true admin experience. But theres alot I dont know ... Im trying to get mailx running. I can create an email, but it never gets delivered to my external email account. I am... (2 Replies)
Discussion started by: popeye
2 Replies

10. Shell Programming and Scripting

Korn Shell script in stopped state while running in background

Hi, I want to run a shell script in background . but its going to stopped state $ ksh cat_Duplicate_Records_Removal.ksh & 8975 $ + Stopped (tty output) ksh cat_Duplicate_Records_Removal.ksh & why is this happening? Also could anyone please tell me what is a stopped... (12 Replies)
Discussion started by: TomG
12 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 10:46 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy