how to make syntax into a korn script??


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting how to make syntax into a korn script??
# 15  
Old 11-14-2007
what does this do?

"cat 1>&2" }
# 16  
Old 11-14-2007
Quote:
Originally Posted by llsmr777
what does this do?

"cat 1>&2" }
redirects output to 'stderr' (standard error)
# 17  
Old 11-14-2007
well that sort of worked.
"End of Report" was still included in the sort.

Also how can I sort the second column by the last two charecters and then by the first one?

Thanks again for all your help!
# 18  
Old 11-14-2007
Code:
nawk ' 
   BEGIN {
     stderr="cat 1>&2"
     print "List\n" "AL\n" "AM\n" | stderr
   }
  /EAST/ {print $3, $2}
  END {print "End of Report" | stderr }' "${1}" | sort -k1,2

I'll leave the rest for you to experiment with 'sort' - good luck!
# 19  
Old 11-14-2007
Thank you again for the help! I will definately poke around.
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Cannot find correct syntax to make file name uppercase letters

I have a file name : var=UsrAccChgRpt I want to make them upper case. Tried: $var | tr Error: tr: Invalid combination of options and Strings. Usage: tr | -ds | -s | -ds | -s ] String1 String2 tr { -d | -s | -d | -s } String1 Could you please help. I am using AIX... (2 Replies)
Discussion started by: digioleg54
2 Replies

2. Shell Programming and Scripting

Pass script with parameter in korn shell script

I have written a script which will take input parameter as another script. However, if the script passed as input parameter has parameters then this script doesn't work. I have a script b.ksh which has 1 and 2 as parameters I have a script c.ksh which has 3,4 and 5 as parameters vi a.ksh... (1 Reply)
Discussion started by: Vee
1 Replies

3. Shell Programming and Scripting

perl script to korn shell script

I have a perl script which replaces "*" with "|" and "~" with "\n" also it takes the file content starting with ST till record starting with SE written a differnet file, I wanted this to be convereted into KSH script, can anyone help me perl script: perl -e ' $file_counter=0;... (7 Replies)
Discussion started by: atlantis_yy
7 Replies

4. Shell Programming and Scripting

help with korn script

Hi guys, I am new to unix scripting. I have a folder rx and it has subfolders rx1,rx2 and rx3 each subfolder has 4 directories each load,land,arch and extr I have the below tar and rm commands using wich we should write a shell script rx1-- tar -cf... (2 Replies)
Discussion started by: Kornscript
2 Replies

5. Shell Programming and Scripting

pass null value to sql script from korn shell script

There are 4 parameters that I have to pass from korn shell to sql script. 1) I have to check if $1 , $2 , $3 and $4 are null values or not . How can I do that ? 2) Once its determined that these values are null (in the sense they are empty) how can I pass null values to sql script... (11 Replies)
Discussion started by: megha2525
11 Replies

6. Web Development

How to make "enter" work in HTML syntax

I have one syntax to find something from desktop on server, the script is as below, I actually speaking don't know anything in this script. It creates a window, where i get a drop down boxes with folder names given below and a blank box where i have to put the folder name to search. and then I... (2 Replies)
Discussion started by: patilrakesh1984
2 Replies

7. Shell Programming and Scripting

Running a BATCH script from my korn script with multiparameters

I've this BATCH script to run from my korn script... The command is /usr/local/BATCH/runBatch.sh PARAM1 'PARAM2 -PARAM21 PARAM22' (runBatch takes parameter 1 = PARAM1 parameter 2 = 'PARAM2 -PARAM21 PARAM22' ) If i run this command from command line it just runs fine... ... (7 Replies)
Discussion started by: prash184u
7 Replies

8. Shell Programming and Scripting

help with Korn script

Hello All.. Can someone tell me how to use "backspace" key in a script. I tried to use ^C (type from the keyboard) but its not working. I know its a silly question to ask but I am really frustated with this thing for good 1 hour or so. I am trying to provide an input file to a script so that I do... (3 Replies)
Discussion started by: solaix14
3 Replies

9. UNIX for Dummies Questions & Answers

korn shell script

hello., i have 2 files.. 1 file is in this folder /home/test/ssk/DSA.WLG.20050713211544.20050710.20050713211544 (this part) other file is in this folder /home/kk/dev/DSA.WLG.20050711210100.20050710.20050711210100 ... (1 Reply)
Discussion started by: pavan_test
1 Replies

10. Shell Programming and Scripting

korn syntax

Hi, how do I write this condition in korn shell: file="*.html" if then echo "$file" fi I am trying to find all html files from a input text file that were created today and ftp them to a different server. please help. (1 Reply)
Discussion started by: sajjad02
1 Replies
Login or Register to Ask a Question