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
1
vote
2 answers
Script SCP without certificates or expect
I need to script SCP and I need to be able to do this by passing in the password in plain text. I am absolutely aware of the horrible design pattern that I am asking for. I cannot use certificates for this application. My challenge is that the box…

wmarbut
- 301
- 2
- 4
- 12
1
vote
2 answers
Solaris 8 - directories gone missing; is this housecleaning script the culprit?
Our outsourced IT service provider runs the following script via cron to clean up Oracle core and trace files. It clearly is not a well-written script, but my question for the Serverfault crowd is whether there is an error or boundary condition…

Dave
- 11
- 3
1
vote
1 answer
shell script + add inside the script PATH for standard output
Usually if we want to redirect script output to file we simply do
/etc/create_connection.sh > file.debug.txt
Or
/etc/create_connection.sh | tee –a file.debug.txt
But What I want is to add /etc/create_connection.sh > file.debug.txt …

Eytan
- 611
- 6
- 13
- 27
1
vote
1 answer
What version of ksh ships with AIX 5.3?
I'm writing a Korn shell script for a client, who will use it on AIX 5.3. For testing, I'm using version 93u-1 Debian Wheezy. Is this the same version as the one I'll find on AIX?

Martin Geisler
- 1,271
- 9
- 23
1
vote
2 answers
ksh93 esc-esc complation
Does anyone know how to set esc-esc completion? I've installed ksh93 from ports on FreeBSD.
set -o vi NOR set -o viraw have any effect
Thanks

Xman
- 11
- 2
0
votes
2 answers
Exclude certain disk in dd command script for disk erasure
for disk in $(lspv | awk '{print $1}') ; do
dd if=/dev/zero of=/dev/${disk} bs=1024 count=$(bootinfo -s ${disk})
echo $disk wiped
done
How do i exclude certain disks like hdisk0,hdisk1 and hdisk3?
Regards,
Adel

Adel Farhad
- 11
- 2
0
votes
5 answers
Solaris: determine if login shell (su -) or not
What's the best way to determine from a ksh script if the current shell is a login shell (su - user) or not (su user).
I'm toying with:
user=$(/usr/xpg4/bin/id -un)
login=$(grep $HOME /etc/passwd | cut -d: -f1 | head -1)
if [ "$login" == "$user" ];…

David Citron
- 143
- 1
- 2
- 7
0
votes
1 answer
Get error "ksh.exe has crashed" when run the command in msys open with admin
When I open msys without admin option on windows server 2008/2012 and run "jbossctl status" command it gives me correct output.
But, when I run the same command in msys opened with admin option it gives me error "ksh.exe has crashed"
Can anyone…

shinek
- 121
- 2
0
votes
2 answers
linux + delete duplicate IP's from file
what the best way to remove duplicate IP's from file
I use the command:
sort file | uniq
but I am not sure if this is the best way , maybe I missed something?
remark: my file contain two fields
example of file
172.17.200.1 3.3.3.3
…

yael
- 2,433
- 5
- 31
- 43
0
votes
1 answer
grep to IP address when IP address in parameter
I need to grep to IP address ( as the following example )
, I use ksh script ,
# ifconfig -a | /usr/xpg4/bin/grep "100\.106\.2\.120 "
inet 100.106.2.120 netmask ffffff00 broadcast 100.106.2.255
but how to grep IP address from parameter…

yael
- 2,433
- 5
- 31
- 43
0
votes
3 answers
grep + Regular Expressions to match uniq number
My target is to verify if $FILE is a backup file ( backup file ended with xxxx.xx.xx.xx number
Example of backup files
ls /etc/VRTSvcs/conf/config
main.cf.17Dec2012.09.10.14
main.cf.17Dec2012.09.10.23
main.cf.17Dec2012.09.10.31
Example of…

yael
- 2,433
- 5
- 31
- 43
0
votes
1 answer
expect script + write "if" in expect script
please advice what's wrong with my exepct syntax ( I run expect in ksh script on Solaris 10 machine )
I want to verify if OS is linux
so if it true the expect check if prompt is "#" or ">"
and then run the "ls" command
but I get the error…

yael
- 2,433
- 5
- 31
- 43
0
votes
1 answer
Weird behaviour with ksh?
So I found something somewhat interesting in ksh. I found that if the last character is \, then immediately backspace, the charcter becomes recplaced with ^H. I am then able to press backspace again to clear it away.
What kind of wizardry am I…

Chad Harrison
- 6,990
- 10
- 29
- 41
0
votes
1 answer
Lock down Solaris Shell Changing for normal users
I have a few dozen Solaris(5.10) boxes. By default, they are using ksh as the shell. Only a few users have sudo privileges. The rest do not. I don't want my regular users changing to another shell.
Here is what I've done:
Minimal sudoers so…

Publiccert
- 1,112
- 1
- 8
- 22
0
votes
3 answers
shell script + match MAJOR and CRITICAL strings from log file
I need to match lines that have MAJOR and CRITICAL strings
that comes after the word ERROR:< any integer number >
please advice how to do that with one awk or sed command?
more HW_Log.txt
CHK_HW ERROR:0 INFO self_monitor …

Eytan
- 611
- 6
- 13
- 27