Questions tagged [ksh]

Use the [ksh] tag for questions about the KornShell

Filter by
Sorted by
Tagged with
0 votes
1 answer
111 views

How can I determine the prematch and postmatch using egrep or ksh under linux

I am working on a issue at the office running on a linux system. I would like to be able to either use egrep or ksh pattern matching to determine not only the matched string but I also need to be able ...
Barry Kimelman's user avatar
0 votes
1 answer
33 views

Find files modified between 2 dates from Source directory(Recursively) and copy it into the Target directory with same directory structure

I am trying to copy the files from source to Target folder which has been modified between 2 dates, #!/usr/bin/ksh source=/home/Amal/DELTA/SOURCE target=/home/Amal/DELTA/TARGET cd $source find ./ -...
Amala's user avatar
  • 1
0 votes
1 answer
180 views

ksh history problem

I'm on Xubuntu 20.04.02 This is a question about ksh command history. Something had changed recently and I'm looking for a way to restore the old behavior. For years and up to about a month or so ago,...
Jeffery Small's user avatar
0 votes
0 answers
775 views

KSH on Ubuntu on WSL

I just installed the Ubuntu app on Windows Subsystem for Linux (WSL). It defaults to a bash shell. I would prefer ksh. I am quite naive when it comes to using package managers to install software. ...
John's user avatar
  • 1
0 votes
2 answers
719 views

KSH syntax error: invalid arithmetic operator (error token is ".111111111 -2.55555")

I have the following example, and I cannot see why. line 48: 15.111111111 -2.55555: syntax error: invalid arithmetic operator (error token is ".111111111 -2.55555") This is my source in ...
cornelia's user avatar
2 votes
0 answers
238 views

Change directory problem in ksh

I work with Ubuntu 18.04.3 My current directory is /home/hans/bin, The directory /home/hans/.sshz also exist. My shell is "ksh." The command cd ../.ssh give the output. ksh cd: /home/hans/ssh:[No ...
Hans van Leeuween's user avatar
0 votes
1 answer
1k views

How to call ksh script within bash script?

I am have written a script which will silently installed Microstrategy on Amazon Linux 2.0 In My main script i am calling Microstrategy installation script which is in /bin/ksh and mine is in /bin/...
Santosh Garole's user avatar
9 votes
5 answers
2k views

Why is a blank required between "[[" and "-e xxx" in ksh?

For instance, the following command does not work: if [[-e xyz]]; then echo File exists;fi ksh gives the following error [[-e: command not found Is that because "[[-" is ambiguous?
AcBap's user avatar
  • 93
0 votes
3 answers
2k views

how to write into cronjob from a shell script

I would like to automate cronjob (meaning schedule a job to be done from a shell script). So i have script that does this #!/bin/ksh timestamp=$(date +%H%M%S) if [ "$timestamp" -eq 230000 ]; then ...
ady6831983's user avatar
0 votes
1 answer
38 views

FTPing inside of a ksh script, get part not working

#!/bin/ksh . $HOME/bin/init.ksh log_start exit_if_not_dgftp EXPIRE_DAYS=30 create_arc_dir handle_error abort $? "Command create_arc_dir failed" $USER purge_archive $EXPIRE_DAYS WORK_FILE=...
Ray's user avatar
  • 1
0 votes
2 answers
699 views

Error in the simple shell script ( i.e.+ : unexpected `end of expression' )?

find_totalusage() { local totalusedsize=0 for dirname in $dirnamelist do dirsize=$(find_dir_size "$dirname") totalusedsize=$(( $totalusedsize + $dirsize )) done ...
Kumarasamy Palanisamy's user avatar
10 votes
3 answers
2k views

Why are numeric function names not allowed?

Consider the following: $ ksh -c '1(){ echo hi;};1' ksh: 1: invalid function name $ dash -c '1(){ echo hi;};1' dash: 1: Syntax error: Bad function name $ bash -c '1(){ echo hi;};1' bash: `1': not a ...
Sergiy Kolodyazhnyy's user avatar
1 vote
1 answer
387 views

How compatible dash is with ksh?

Can I make /bin/sh symlinked to /bin/ksh instead of /bin/dash without breaking anything in the process ? Since they're both supposed to be POSIX-compliant, can I reasonably expect the replacement to ...
Sergiy Kolodyazhnyy's user avatar
0 votes
1 answer
47 views

Where can I find a list of the features from Korn and C shells incorporated by Bash?

I would like to have some documentation about the features from Korn (ksh) and the C (csh) shells incorporated in the Bash command language interpreter. A exhaustive list of commands would be great. ...
Sandro Sivsivadzé's user avatar
1 vote
0 answers
216 views

Login Errors with KSH

My cloud team setup a Ubuntu 16.04 AMI for me in AWS. They have done some items to 'Harden' the instance but they normally use amazon linux and not Ubuntu so I think they have broken some things. ...
Edward S.'s user avatar
  • 111
12 votes
1 answer
6k views

What are these auxiliary file descriptors?

While poking around /proc/self folder for my mksh shell, I found a peculiar thing: in /proc/self/fd/* there are all the standard file descriptors (0 for stdin, 1 for stdout, and 2 stderr) some file ...
Sergiy Kolodyazhnyy's user avatar
0 votes
1 answer
918 views

Difference between bash-shell and ksh-shell by using while with read - what can I do in bash for the same response as in ksh?

I have two scripts: in bash #!/bin/bash H_VARIABLE=empty echo "Zeile1 Zeile2" | while read satz do H_VARIABLE="$H_VARIABLE $satz" done echo H_VARIABLE=$H_VARIABLE Result: H_VARIABLE=...
Jürgen Hahnefeld's user avatar
1 vote
1 answer
317 views

Default login shell ksh [closed]

I want to set the default login shell to the Korn shell (ksh) but chsh doesn't recognize /bin/ksh as a shell. /bin/ksh has been loaded.
Clientscope's user avatar
8 votes
3 answers
12k views

How do I change to ksh?

I need to learn some ksh details, but i don't want to change from bash to ksh permanently. What should i do? Is it possible to change shell only for a specific console session?
sonnuforevis's user avatar
  • 1,533