Skip to main content

Questions tagged [ksh]

The Korn shell (ksh) is a shell with advanced scripting features, commonly found on commercial unices and some BSD systems but rarely used on Linux.

1 vote
2 answers
155 views

In bash I can use local -n ref_name=$1 to pass an argument to a function by reference, but the same syntax in ksh throws an error saying typeset: -n: unknown option I tried nameref ref_name=$1 ...
Harry's user avatar
  • 239
1 vote
2 answers
269 views

In Bash I can use $(type -t function_name) = "function" to check if the function by name function_name exists or not in a sourced file which is sourced using source file_name command. I'm ...
Harry's user avatar
  • 239
1 vote
1 answer
87 views

I have the below shell script which works fine in Bash to list all the directories residing inside a given directory path and add them to an array. But the same script code doesn't work in KornShell. ...
Harry's user avatar
  • 239
-2 votes
2 answers
114 views

so trying to capture history with date and readable timestamps AND the command should appear on same line. following is failing: Bash ver is: GNU bash, version 4.4.20(1)-release (x86_64-redhat-linux-...
Rajeev's user avatar
  • 268
8 votes
1 answer
331 views

I am a long time ksh user, and use bash under duress - both in 'vi' editing mode. One thing that has always niggled - after searching back through history for a command (.e.g <Esc>/needle), how ...
Annihilannic's user avatar
-1 votes
1 answer
99 views

Why does ksh history -0 (last command which is the history command itself) work, yet zsh it fails (only history -1 avail on my zsh). I tried zsh -f to use default options and it still fails. I'm ...
atod's user avatar
  • 155
0 votes
1 answer
91 views

How do I obtain a variable with the current command and arguments? I would like to use escape code to print this in an Xterm title bar. I see Terminal.app on MacOS is determining the name of the ...
atod's user avatar
  • 155
3 votes
1 answer
265 views

Does anyone know what's occurring with zsh below and how to get the same behavior I show with ksh and bash? I'm noticing zsh on MacOS v13.7 is skipping even commands numbers in its history output, ...
atod's user avatar
  • 155
0 votes
0 answers
63 views

How do I accomplish this command to redirect command output to multiple files, without retyping the later A=1>&/dev/tty 1>&${TMP}/lastcmdout every time? I want to see output on the ...
Nick's user avatar
  • 205
0 votes
0 answers
58 views

I have problems with replacing parentheses in combination with variables, in ssh. For instance, replacing (hello123blablabla) with (hello). So, it replaces all together, and parentheses as well, at ...
armagedescu's user avatar
-5 votes
1 answer
107 views

to make a script more secure, we would need to confirm that used cmds, eg.: "/usr/bin/chown" instead of just "chown".
robert8819's user avatar
1 vote
1 answer
45 views

I'm running Korn 93u+ and I want to echo the current time each time I enter a command. I currently just put the time in my PS1, but that's obviously flawed because if I leave the command line for some ...
Yehuda's user avatar
  • 351
0 votes
1 answer
69 views

I am reading a book about dtksh. The first "hello world" example begins as follows: #!/usr/local/dt/bin/dtksh . $UTILDIR/xutil.sh XUinitialize TOPLEVEL Hello "$@" XUlabel LABEL $...
M.E.'s user avatar
  • 651
5 votes
1 answer
369 views

I'm experiencing extremely sluggishness in opening subshells (by using ` ` or $( ) command substitutions in scripts) while in ksh on some Linux servers. The same problem does not exist in sh or any ...
Paul W's user avatar
  • 183
3 votes
2 answers
133 views

My shell is the Korn Shell, but I think the problem (and its eventual remedy) applies to other shells as well. I usually build a "simulation mode" into my scripts to test potentially ...
bakunin's user avatar
  • 793

15 30 50 per page
1
2 3 4 5
56