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
193
votes
8 answers
How do I sleep for a millisecond in bash or ksh
sleep is a very popular command and we can start sleep from 1 second: # wait one second please sleep 1 but what the alternative if I need to wait only 0.1 second or between 0.1 to 1 second ? remark: on linux or OS X sleep 0.XXX works fine , but on…
yael
- 2,593
- 5
- 33
- 43
29
votes
4 answers
How to pipe stderr without piping stdout
How do I pipe the standard error stream without piping the standard out stream? I know this command works, but it also writes the standard out. Command 2>&1 | tee -a $LOG How do I get just the standard error? Note: What I want out of this is to just…
C. Ross
- 3,145
14
votes
8 answers
executable in path, findable by which, yet cannot execute without fully qualifying path?
I've got a bizarre seeming shell issue, with a command in the $PATH that the shell (ksh, running on Linux) appears to cowardly refuse to invoke. Without fully qualifying the command, I get: # mycommand /bin/ksh: mycommand: not found [No such file or…
Peeter Joot
- 385
6
votes
2 answers
linux + how to identify if file is pointed by link/s
I create new file called - 192.9.200.1 touch 192.9.200.1 then I create new link that will be pointed to 192.9.200.1 file ln -s 192.9.200.1 file so finally I get: ls -ltr /tmp -rw-r--r-- 1 root root 0 May 8 19:39 192.9.200.1 lrwxrwxrwx 1 root root 11…
yael
- 2,593
- 5
- 33
- 43
5
votes
2 answers
home, end, delete, pageup, pagedown with ksh
I want to use home, end, delete, pageup, pagedown with ksh. My TERM is xterm-color. These keys works fine with tcsh and zsh, but not with ksh (print a tilda ~) I found this: bind '^[[3'=prefix-2 bind '^[[3~'=delete-char-forward bind '^[[1'=prefix-2…
Nicolas
- 51
5
votes
2 answers
expect + how to identify if expect break because time out?
The target of the following simple expect script is to get the hostname name on the remote machine Sometimes expect script fail to perform ssh to $IP_ADDRESS ( because remote machine not active , etc ) so in this case the expect script will break…
Eytan
- 621
5
votes
6 answers
how do I make solaris shell more familiar for a linux user?
I've been a linux user for years. Very used to the bash shell, used to linux shell key mappings that come with most mainstream distros. I'm also a happy vim user in linux & love my arrow keys. Just started a job where 90% of the systems are solaris…
Nick Kavadias
- 10,906
4
votes
2 answers
How to identify ancient KornShell version?
We had a guy retire on us, and the documentation left behind is a little on the light side. Need a little help identifying and using part an older client-server system. The server itself is maintained by several excellent Unix admins. We are…
JonathanDavidArndt
- 1,434
3
votes
2 answers
rm + how to remove file with special Characters
I have this file in my linux machine: ----------9976723563nneh4_-----192.9.200.4 I try to delete this file but I cant as all see here: what need to add to rm in order to remove this file ? rm "----------9976723563nneh4_-----192.9.200.4" rm: illegal…
yael
- 2,593
- 5
- 33
- 43
3
votes
3 answers
Delete key not working when PuTTYed in to AIX box using Korn shell
I manage an AIX box at work using PuTTY. I'm using ksh in vi-mode. When I press the Delete key (not backspace) the case of following characters is toggled instead of the character under the cursor being deleted. I'm not necessarily looking to change…
bshacklett
- 1,388
3
votes
1 answer
shell script (KSH) + set file to param & perform test between param and string
in my linux machine red-hat 5.1 - in ppp file - I have only the signature.pl string !!! remark - third application write the signature.pl string in to ppp file I set ppp file in $a param And compare $a with signature.pl But as all see here this not…
Eytan
- 621
3
votes
2 answers
Preventing bash (and ksh) history alteration in Linux
From the looks of things, fixing ksh to make history alteration impossible is fairly easy. I've seen all the recommendations to make HIST* environment variables read-only, and the use of chattr to make the history file append-only (with chattr +a…
Mei
- 4,620
2
votes
3 answers
Providing command line arguments for an executable through a shell script
Suppose I have an executable xyz that takes a variable number of command-line arguments, and a wrapper Korn shell script xyz.ksh . Is there an easy way to pass all of the shell script arguments as-is to the executable?
An̲̳̳drew
- 1,413
2
votes
2 answers
sed + how to remove the last string after specific character
how to remove the last string after "." character include the "." character itself implementation can be with sed under Linux/Solaris operation system example of IP address before change 192.9.200.1 ( need to remove the .1 ) expected results…
yael
- 2,593
- 5
- 33
- 43
2
votes
1 answer
AIX 7.1 .kshrc ignored
I've created .kshrc file in my home directory, but all my custom settings are ignored. ENV variable is not set. How can I force ksh to read .kshrc? Here is my .kshrc: set -o emacs export PATH=$PATH:/home/ibykov/bin:/usr/vacpp/bin…
ibykov
- 53
- 5