Sponsored Content
Full Discussion: Korn Shell Loop Problems
Top Forums Shell Programming and Scripting Korn Shell Loop Problems Post 302882305 by kshji on Monday 6th of January 2014 05:20:24 AM
Old 01-06-2014
Scrutinizer last example is posix compatible - works fine in bash, ksh, dash, ...

If you like to use full ksh93 properties, then download it.
Or build from sources.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

KORN Shell - Spawn new shell with commands

I want to be able to run a script on one server, that will spawn another shell which runs some commands on another server.. I have seen some code that may help - but I cant get it working as below: spawn /usr/bin/ksh send "telnet x <port_no>\r" expect "Enter command: " send "LOGIN:x:x;... (2 Replies)
Discussion started by: frustrated1
2 Replies

2. Shell Programming and Scripting

how to convert from korn shell to normal shell with this code?

well i have this code here..and it works fine in kornshell.. #!/bin/ksh home=c:/..../ input=$1 sed '1,3d' $input > $1.out line="" cat $1.out | while read a do line="$line $a" done echo $line > $1 rm $1.out however...now i want it just in normal sh mode..how to convert this?... (21 Replies)
Discussion started by: forevercalz
21 Replies

3. Shell Programming and Scripting

Korn Shell Loop question

I'm needing help with assigning variables inside a while loop of ksh script. I have an input text file and ksh script below and I'm trying to create a script which will read the input file line by line, assign first and second word to variables and process the variables according to the contents. ... (4 Replies)
Discussion started by: stevefox
4 Replies

4. Solaris

Problems with korn shell script

Hey Guys, I'm looking for some advice about a korn shell script I've written. I've spent hours googling for an answer hopefully someone here can help me out. Basically the part of the script I'm having problems with is when I need to SFTP a file from one server to another. The line looks... (6 Replies)
Discussion started by: hilather
6 Replies

5. Shell Programming and Scripting

Help With Constructing A Korn Shell Search Loop

Hello All, I am a statistician and I am very new to the world of ksh programming. Daily, I analyze millions of rows of data and land information to DB2 tables. I have recently been asked to develop a ksh script to FTP an export file containing line item data from the production environment to the... (2 Replies)
Discussion started by: jonesdk5
2 Replies

6. Shell Programming and Scripting

How to activate Korn Shell functionnalities in Bourne Shell

Hi All I have writing a Korn Shell script to execute it on many of our servers. But some servers don't have Korn Shell installed, they use Borne Shell. Some operations like calculation don't work : cat ${file1} | tail -$((${num1}-${num2})) > ${file2} Is it possible to activate Korn Shell... (3 Replies)
Discussion started by: madmat
3 Replies

7. AIX

for loop problems

I have a script that loops through a list of users to list files owned by these users for u is `cat users.list` do echo $u >> result.out find /home -user $u >> result.out find /var -user $u >> result.out find /opt -user $u >> result.out find /usr -user $u >> result.out done an so... (3 Replies)
Discussion started by: Dardeer
3 Replies

8. Shell Programming and Scripting

Bourne shell & Korn shell

Could some one tell me the difference btw Bourne shell and the Kshell? Which is more flexible and reliable in terms of portability and efficiency. When i type the following command .. $ echo $SHELL yields me /bin/sh Does this tells me that I am in Bourne shell. If yes, how can i get... (6 Replies)
Discussion started by: bobby1015
6 Replies

9. Shell Programming and Scripting

[Solved] Issue with using for loop as for in {2..6} in korn shell

Hi i have to cut columns 2 to 6 from a file and assign it to arrays , The following code works for ctcol in 2 3 4 5 6; do set -A a$ctcol $(cut -d, -f $ctcol test_file) done how ever this does not work for ctcol in {2..6}; do set -A a$ctcol $(cut -d, -f $ctcol test_file)... (4 Replies)
Discussion started by: 100bees
4 Replies

10. Shell Programming and Scripting

How to print the missing fields outside the for loop in Korn shell?

I have 2 for loop in my program , first one will list files based on timestamp and second one list the files based on type(RPT / SUB_RPT).Here is my code: #!/bin/ksh STG_DIR=/home/stg for pattern in `find $STG_DIR -type f -name 'IBC*csv' | awk -F'' '{print $(NF-1)}' | sort -u` do echo... (2 Replies)
Discussion started by: ann15
2 Replies
DIFFINDEX-DOWNLOAD(1)													     DIFFINDEX-DOWNLOAD(1)

NAME
diffindex-download - Download utility for Debian Contents files SYNOPSIS
diffindex-download [ options ] URL filename DESCRIPTION
diffindex-download is a command line tool for downloading Contents files. It uses APT's diff/Index format patches when available to avoid downloading the full file. diffindex-download is used by apt-file. OPTIONS
-n number If more than number patches would be necessary, download the whole file. Specifying 0 to always download the whole file is possible. -k Don't verify the peer certificate when using https. -c cacert If cacert is a directory: Use cacert as CA certificate path. Otherwise use cacert as CA certificate bundle. See the --capath and --cacert options in the curl(1) man page. -i Don't exit with errror if the URL does not exist. This is useful as some archives don't provide Contents files. -q Be quiet (opposite of -v). The default if stdout is not a terminal. -v Be verbose (opposite of -q). The default if stdout is a terminal. -d Print additional debug info. -h Display a short help screen. SEE ALSO
apt-file(1), diffindex-rred(1), curl(1) AUTHOR
diffindex-download was written by Stefan Fritsch <sf@debian.org>. January 2009 DIFFINDEX-DOWNLOAD(1)
All times are GMT -4. The time now is 03:38 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy