Ksh is the executable name for the Korn shell developed by David Korn at AT&T Laboratories in the early 1980s. It is commonly used in Solaris and is favored for its ability to use Emacs and Vi shortcuts at the command line.
Questions tagged [ksh]
58 questions
2
votes
3 answers
linux + match only VALID IP from text file into other file
please advice how to match only the valid IPs ( 255.255.255.255 )
from the file.txt
and insert only the valid IP into VALID_IP.txt file
( see VALID_IP.txt for example )
the solution should be implemented in my ksh script ( so perl or sed or…

yael
- 2,433
- 5
- 31
- 43
2
votes
4 answers
linux + create simple watch dog process in shell script
I need to create watch dog process (will run in linux version 5.x)
that look all time on /etc/cluster.cf file
And if the process matches the string: machineA_is_active in the cluster.cf file
Then this process will execute other script
My question…

Eytan
- 611
- 6
- 13
- 27
2
votes
2 answers
What do the 2 leading underscores indicate in these alias lines for .kshrc?
I am configuring ksh88 on AIX 5.3L and came across a few lines that are supposed to enable the arrow keys for command history navigation.
alias __A=$(print -n "\020")
alias __B=$(print -n "\016")
alias __C=$(print -n "\006")
alias __D=$(print -n…

Buggabill
- 179
- 2
- 10
2
votes
2 answers
ctrl-v key on AIX
I'm new to AIX and I miss some tricks that work well on other *nix flavors.
I need a CTRL sequence in a ksh scripts, like ^[ (CTRL-[) and to do that I'm habit to use the ctrl-v [ , but here it doesn't work.
At the moment I'm obliged to use a windows…

tmow
- 1,227
- 9
- 20
2
votes
3 answers
Will uploading modified version of a KSH script affect processes that are currently running the script?
Let say I have a KSH script my_script.ksh that performs complex operations including but not limited to invoking SQLPLUS to manipulate large number (millions) of records in an Oracle database. The script accepts a few parameters that determine which…

Lukman
- 186
- 6
2
votes
2 answers
How to process a file line by line in ksh?
How can you process a file line by line in ksh?

Matthew Watson
- 294
- 2
- 6
- 14
1
vote
0 answers
KSH/Bash History for jailed SSH users
How can I keep a history of activities for chroot'd SSH (not SFTP) users?
I've tried:
created a .sh_history in their home with the proper permissions
created a custom $HISTFILE in .profile and in its jailed /etc/profile
exported HISTFILE after…

Dumb admin
- 127
- 12
1
vote
2 answers
Shell script file name format
What does the following shell script mean?
This is ksh and npfile is also a variable that contains a file name.
fileName=${npFile##/*/}

C. Ross
- 3,075
- 9
- 35
- 36
1
vote
1 answer
Linux + exit status from Perl one-liner code
I use Perl one-liners in my ksh scripts.
Sometimes it's necessary to get an exit status from the Perl one-liner in order to verify if the Perl one-liner succeeded or not.
For example, I need to verify if the "print" in the Perl one-liner code…

yael
- 2,433
- 5
- 31
- 43
1
vote
2 answers
re-create new link and remove the old link on one command
according to ln manual page:
man ln
-f, --force
remove existing destination files
so as I understand if I want to re-create new link to some destination directory/file
I can simply do
ln -s -f some_directory new_link
but…

Eytan
- 611
- 6
- 13
- 27
1
vote
2 answers
how to see process status with full details
I run the script - my_script.ksh as process with 5 long arguments
on my solaris/linux machine ( example 1 ) ,
Later I verify the process by
ps -ef | grep my_script.ksh
I don't understand way I not get the all arguments from ps -ef ? , ( see…

yael
- 2,433
- 5
- 31
- 43
1
vote
1 answer
Logging commands executed by remote shell scripts
I've noticed that when running a script that connects to a number of our servers (to essentially run batch commands) that the commands aren't logged in the user's .sh_history or .bash_history files. Is there a place where this is logged (assuming…

Dan Wolfe
- 11
- 1
1
vote
2 answers
ksh + match and verify two strings in single line
how to match the words linux1a and linux1b from single line ? ( should be performed by ksh )
list="solaris1a Auto global linux1a linux1b"
echo $list | .... ?
my target is to find that linux1a and linux1b are exists in the line {…

yael
- 2,433
- 5
- 31
- 43
1
vote
1 answer
expect script + how to perform case in expect script
the following expect script target is to print the hostname name from linux/solaris machine
and according to hostname results expect script will run linux.ksh or solaris.ksh script
expect_sun_script=`cat << EOF
set timeout -1
spawn telnet 0…

yael
- 2,433
- 5
- 31
- 43
1
vote
0 answers
Automate an interactive command which use /dev/tty
well pretty much it's in the title.
I've a interactive command. This one ask for a password through /dev/tty. I use this command within a shell script. So the command should read the information through stdin.
I've explored some ways to do…

Daniel
- 121
- 1