Questions tagged [ksh]
The KornShell is an open source, POSIX-compatible shell language from AT&T based upon the original Bourne shell. Make sure you know whether your ksh is ksh93 or a clone.
2,763
questions
0
votes
1
answer
31
views
How can I specify --add-exports during execution of java
I have jar package complied with java 1.8. Now migrated to java 17. Ksh file contain the java command
/etc/alternatives/jre_1.8.0/bin/java $JAVA_OPTS -DDB_INFO_FILE=$DB_INFO_FILE -DRCFILE=$RCFILE -...
-1
votes
0
answers
20
views
Generate tree from SQL in ksh
This code only shows the first level and the leaves of the first element of that level that is directly connected to the root (the leftmost one).
Could you please tell me what error I am making? Thank ...
0
votes
0
answers
21
views
Autosys Command Job is not triggering Teradata BTEQ script
I have autosys job with below JIL configuration
insert_job: APP.C
command : /NAS_MOUNT/run_bteq.ksh FOLDERNAME SCRIPTNAME.btq
machine : serverA.com
owner : John
profile: /NAS_MOUNT/.John_profile
If I ...
0
votes
0
answers
29
views
Variable value lost in bash when input comes from a function [duplicate]
The following script mimics a problem I met in a larger script.
loop-break-example-functions.sh:
#!/bin/ksh
#!/bin/bash
function loop_function {
echo_function | while read one two three
do
echo ...
2
votes
2
answers
65
views
Avoid the duplication in the script
The code below is duplicated twice in the full script, how to avoid it?
if jurge_expr ; then
(( retry_cnt += 1 ))
echo $CS2
echo "reading CS2 checking ...
-1
votes
1
answer
62
views
How to run a ksh script in Cygwin through Windows Batch file [duplicate]
I'm currently using Cygwin to run a kornshell script that parses files present in the /home/myname/files directory. I've been doing this manually so far.
Is there a way to run this automatically. ...
0
votes
3
answers
59
views
Shell script - How to display variable names and their values in loop
I am trying to display variable names and their values in a for loop, through a ksh shell script. But I'm not sure how to do that. Should I use something like eval for this?
Here is an example script:
...
0
votes
1
answer
52
views
Syntax to pull filename.ext*, but not filename.ext*.*
I mean I can't figure this one out so far.
file1.ext1
file7.ext2
fileQ.ext3
# should be accepted
file1.ext1.bak
# should not be accepted
@tim roberts - almost there, except file1.ext11 or file1.extAB ...
0
votes
3
answers
95
views
unable to capture the erroneous record number while processing huge text file [duplicate]
the input for this job is a huge .txt file.
#!/bin/ksh
while read -r line
do
awk ' BEGIN {FS= ","}
$2 ~ /[mM]/ {
if ($12 ~ /[1-9]+/ )
{
SECNext=$13
...
-1
votes
1
answer
95
views
Looking for KornShell (ksh93) User Defined Type (typeset -T) documentation/examples
A couple of months ago I came across Musings of an OS plumber. The one posting that really caught my attention was Using Types To Create Object Orientated Korn Shell 93 Scripts.
Ever since then I have ...
-4
votes
5
answers
232
views
Replace column values of one file with values present in another file [closed]
Consider two files
file 1:
name|gender|phone|email|city|country
abc|F|11111|ldiskmsjdh|pune|india
xyz|M|22222|wassrrrrtf|delhi|india
file2:
sno|name|email|country
1|abc|zzzzzzzz|USA
2|mnq|tttttttt|...
0
votes
1
answer
84
views
String substitution with sed
I'd like to do the following transformation within a file (named inputfile) with sed
Searched line :
$CmdVar $ENV\util.exe firstparm secondparm
Searched pattern is util.exe ; firstparm and secondparm ...
0
votes
2
answers
52
views
Bash Pass local file with params to remote server
How can I run a file and pass variables to a file that is local over to a remote server?
When I run the code below, with redirecting the file_in without the <, it does work.
This works, but the ...
0
votes
2
answers
55
views
ksh behaves differently for telnet command
I am trying to do telnet a Linux host inside ksh script, but the output seems to different when the same script is executed as bash script. Anyone has any Ideas ?
When the script when executed as bash
...
0
votes
1
answer
122
views
SFTP - Listing files in a directory and writing the output to a .txt file
[EDIT]
I am writing a script that should pull files from a remote server using SFTP and pull them onto a unix directory using KornShell. I am having various issues with this, the main one being that ...