Skip to main content

Questions tagged [ksh]

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

0 votes
0 answers
320 views

way to globally add timestamps to terminal output?

I am trying to find a way to have all terminal output from .ksh scripts to have a time stamp pre-pended to the beginning of the line. The challenge is, the scripts I want to add these time stamps to ...
Matt Curry's user avatar
0 votes
1 answer
695 views

How to decrease the length of the output of "ps -ef" command? It is showing full output with unlimited length

When running ps -ef command on our new solaris server the command outputs the full arguments of the processes including passwords and usernames. It seems the length of characters it is showing is ...
Harold Ortiz's user avatar
1 vote
1 answer
139 views

Misplaced sub-shell in bash

I'm having trouble with an unfortunate mis-feature in bash, illustrated by this function: trying () { res=0; echo $res; cat some_text_file | while read op rpt rec; do res=1; ...
j4nd3r53n's user avatar
  • 399
2 votes
0 answers
100 views

Invalid function name "," in ksh

This is my system: # cat /etc/*release* PRETTY_NAME="Debian GNU/Linux 9 (stretch)" NAME="Debian GNU/Linux" VERSION_ID="9" VERSION="9 (stretch)" VERSION_CODENAME=...
j4nd3r53n's user avatar
  • 399
0 votes
0 answers
19 views

Joining directories, logically? [duplicate]

This is quite possibly just a silly question, and I suspect I already know the answer, but I might learn something new, so ... I recently learned about the CDPATH environment variable, which lists a ...
j4nd3r53n's user avatar
  • 399
0 votes
1 answer
967 views

how to count the number of occurrences of a word in different files? -BASH

I have files like raw_data_0, raw_data_1... raw_data_7 every file contains below data record_count=1 emailCountFailure=0 record_count=1 emailCountFailure=0 record_count=1 emailCountFailure=0 ...
sai prudhvi's user avatar
1 vote
0 answers
326 views

How do I send my command history to two different history files?

Is there any way to have my commands sent to a secondary history file besides the default history location? I know that setting HISTFILE will send my commands to a custom locations, but I still want ...
Sidd Singal's user avatar
0 votes
1 answer
409 views

While loop is exiting before the end of the file

I am reading a file and writing and the while is exiting before reaching the end of file. Always it is existing at n-1. Can someone help me?
SRILEKHA TANGUDU's user avatar
0 votes
1 answer
122 views

While loop stopped working

#!/usr/bin/ksh # set the Internal Field Separator to a pipe symbol IFS='|' # file name file=/backup/diskonly_backupfiles/EMPTORIS_ACE/LATEST/Batch1/contract.txt # use while loop to read domain and ...
SRILEKHA TANGUDU's user avatar
1 vote
1 answer
3k views

What does asterisk (*) meant in Linux for-loop

I have this .ksh script snippet: for type in * do cd ${DATA_HOME}/$type for mid in * do #doing something here done done My question: So what does the asterisk * ...
user3437460's user avatar
0 votes
0 answers
167 views

Setting up ksh task in Cmder

I'm looking for a way to use a korn shell in Cmder. I'm trying to add an entry in the Task menu which would let me start a new ksh window. I looked at mksh, to no avail yet. There seems to be some ...
Alexis Dufrenoy's user avatar
1 vote
1 answer
2k views

How to reverse-i-search in ksh through SSH?

I'm currently using PuTTY to connect to some Linux server (ksh on RHEL if that matters). However using Ctrl+R doesn't work (only ^R appears on the screen). I'm quite surprised that despite all my ...
Asoub's user avatar
  • 73
1 vote
1 answer
339 views

Ksh/Bash script to run commands based on kernel name

I am trying to build a script that will take all hostnames from a file and run various commands depending on the kernel name. I first want to ssh to the host machine and after issuing an uname -a ...
Stan K's user avatar
  • 25
0 votes
1 answer
213 views

ksh - Reading an unset variable into an array using the read command

I have the following ksh script, where $an_unset_var is an unset variable which is being used for the first time: read -A arr <<< "$an_unset var" echo ${#an_unset_var} echo ${#arr[*]} ...
Neil's user avatar
  • 103
1 vote
2 answers
2k views

unix shell tips to assign boolean value to variable from a test

code to show the request in context (unix ksh currently): r=$( [ -z "foo" ] && echo true || echo false ) is there a better, simplerway to assign r with true or false something like r=$( [ -...
NeronLeVelu's user avatar

15 30 50 per page
1
2 3 4 5 6