ksh, short for Korn Shell, is a Unix shell developed in the early 1980s.

learn more… | top users | synonyms

0
votes
1answer
38 views

How to write code for this archival scenario?

Say after the 1st run, 10 files got created with def user id in abc directory. I tarred the 10 files created by def user id in a tar file with date time stamp extension. Now after the 2nd run, ...
4
votes
3answers
2k views

Unix history not working

I'm using ksh on unix and connect through putty. My .sh_history stores all history commands but when I press up arrow nothing comes, please help me.
0
votes
0answers
96 views

Overlapping lines in AIX 5.3

When I type commands and hit enter my cursor line for some reason appears on the the second line from the end of the output: tomcat [server] /home/tomcat: ls -l total 24 -rwxr-x--- 1 tomcat dev ...
4
votes
2answers
868 views

How can I keep reading from a pipe even after the pipe is closed?

I've got a ksh script that calls: while read LINE do... The input has been redirected (not shown) so that it reads input from a pipe. The problem is that when the writer to the pipe closes, read ...
1
vote
1answer
623 views

Using readline keyboard shortcuts in OSX korn shell

I am using ksh on Mac OS X 10.6 xterm (that is, not using Terminal.app). When I try to browse the command history via CTRL+P or try to move the cursor on my prompt via CTRL+B, only the characters ^P ...
15
votes
1answer
18k views

How to set default screen colours in putty/ssh

I use putty to ssh to linux box. By default I get black screen background with white foreground. To change colours, I go to change settings -> Window/colours and then I set background colours as ...
1
vote
2answers
1k views

count words in LIST without separators

I have the following simple ksh code: MY_LIST=first,second,third NUM_IN_LIST=` echo $MY_LIST | sed s"/,/ /g" | wc -w ` print $NUM_IN_LIST 3 [[ $NUM_IN_LIST = 3 ]] && print match but I ...
1
vote
1answer
1k views

Re-redirect STDERR in K/SH?

Once STDERR is redirected, for example to a file, how can it be redirected back to the original file descriptor 2? #!/bin/sh exec 2>/tmp/err print -u2 'log errors to file' exec 2>&2 (how ...
0
votes
5answers
884 views

Start linux command with “su” and inline variable

I'm trying to create mozilla profile for another user from command line using su. When I'm trying from X, this will work. su myuser -c 'mozilla -CreateProfile newprofile' But my goal is to embed ...
1
vote
2answers
5k views

AIX : retrieving previous command using up arrow

I know about set -o vi and k and j combinations. I want to map these to up arrow and down arrow so that I can use AIX(ksh prompt) just like bash . Any suggestions?
2
votes
3answers
5k views

unix command to see the last run command on command line

what is the command to see the previously executed command that was run on the command line ?
0
votes
2answers
886 views

How to repeat commands from history in ksh vi-mode

Say I have a hundred commands in my shell's history, and now I'd like to repeat commands 74 through 78. In the emacs mode of bash/ksh/zsh, I would navigate back to command 74 then hit Control-O on ...
4
votes
1answer
195 views

Create a file whose size in bytes is the percentage of free space on a disk

I needed a command-line method of creating a file whose size in bytes is the percentage of free space on a disk. I intend to run it via cron every five minutes, but first a shell script will do. The ...
0
votes
1answer
75 views

Is There Any Danger in Closing a Parent Xterm Shell with an Active Child?

When I log into my unix servers, I get an xterm window and usually open several more from that initial one. Is there any danger in closing the first window but keeping the children windows open?
2
votes
1answer
215 views

ksh equivalent of perl $! error reason

Is there an equivalent of $! in ksh, which provides the error string ? $? stores the exit code only.