Question about KSH line.


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Question about KSH line.
# 1  
Old 06-22-2004
Question about KSH line.

Wondering what this line meant, especially the 2>&1 and ${RUN_DIR} parts:
${RUN_DIR}/<filename> 2>&1

Where <filename> is the location and name of a file.
# 2  
Old 06-22-2004
${RUN_DIR}
evaluates whatever the variable RUN_DIR is, and translates it
like: RUN_DIR=/my/path

2>&1 dups (duplicates) the output of stderr (2) into stdout (1).
In other words all of the program output is available on just one output file descriptor - the stdout (usually a terminal) device.

And <filename> is probably just that - a file name with no path.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Ksh: Read line parse characters into variable and remove the line if the date is older than 50 days

I have a test file with the following format, It contains the username_date when the user was locked from the database. $ cat lockedusers.txt TEST1_21062016 TEST2_02122015 TEST3_01032016 TEST4_01042016 I'm writing a ksh script and faced with this difficult scenario for my... (11 Replies)
Discussion started by: humble_learner
11 Replies

2. Shell Programming and Scripting

ksh prompt yes/no question

I am writing a code like this in KSH . #!/bin/ksh echo is this SQL query ? yes or no read answer case $answer in yes|Yes|y) echo got a positive answer ;; no|n) echo got a 'no' ;; esac Here after ... (2 Replies)
Discussion started by: talashil
2 Replies

3. Shell Programming and Scripting

Extract Line and Column from CSV Line in ksh or bash format

Hi, I was doing some research and can't seem to find anything. I'm trying to automate a process by creating a script to read a csv line and column and assigning that value to a variable for the script to process it. Also if you could tell me the line and column if it's on another work ... (3 Replies)
Discussion started by: vpundit
3 Replies

4. Shell Programming and Scripting

Question regarding ksh script

Hi all, I have came across the following line in a script and was not able to interpret the meaning despite searching in the web for answer, my guess is that it seems like a comment to me stating if 0 then return else exit ============================ : 0 - 999 .... ........ (3 Replies)
Discussion started by: dwgi32
3 Replies

5. Shell Programming and Scripting

KSH: Reading a file line by line into multiple arrays

Hi - I have a file that contains data in this format:- #comment value1 value2 value3 #comment value4 value5 value6 value7 #comment value8 value9 I need to read value1, value2 and value3 into one array, value4 value5 value6 and value7 into another array and value8 and value9 into a 3rd... (2 Replies)
Discussion started by: sniper57
2 Replies

6. Shell Programming and Scripting

read a file line by line in ksh

Hi, In ksh we use 'while read line' statement to read a file line by line. In my input file I have 5 spaces appended at the end of each line. When I use while read line statement it chops off the spaces at the end of each line Inp.txt aaaa<five spaces> bbbb<five spaces> cccc<five spaces> ... (3 Replies)
Discussion started by: chella
3 Replies

7. UNIX for Dummies Questions & Answers

ksh question

How can I know if my system has ksh feature? #!/usr/bin/ksh Which command we allow me to see? Please advise! (1 Reply)
Discussion started by: bobo
1 Replies

8. Shell Programming and Scripting

Conversion question about ksh

Hi all, New to ksh and had a few questions to see if this is doable in ksh or if I am going to have to call out to a tcl procedure. I have an Ascii file I want to convert to hex then search and remove all hex chars '0A' and then convert back to Ascii. Here is an example of an Ascii file I am... (2 Replies)
Discussion started by: hgjdv
2 Replies

9. Shell Programming and Scripting

A Question On Recursion In Ksh

Hi Folks, I would just like to know how recursion works in ksh or inside a shell in general. I created the following script, but it works(runs recursively) only for 64 times: ---------------- #! /usr/bin/ksh displaymessage() { echo "displaying count: $cnt " echo "wait for 1 second..."... (1 Reply)
Discussion started by: marlonus999
1 Replies

10. Shell Programming and Scripting

KSH scripting question

Good day, I am trying to write a script that completes an ssh challenge to a specific server and writes output to a log. We have shared ssh keys for the script user. My challenge is a simple hostname check; ssh $host hostname My problem arrises when there is an actual challenge, be it... (3 Replies)
Discussion started by: M-Pacificorp
3 Replies
Login or Register to Ask a Question