Sponsored Content
Top Forums Shell Programming and Scripting ksh/nawk help with if statement to choose between 2 files Post 302537404 by radoulov on Friday 8th of July 2011 05:04:12 AM
Old 07-08-2011
I suppose I wasn't clear enough, the no pad flag is the dash (-) right after the %:

Code:
$ date +%d; date +%-d
08
8

Anyway it seems a GNU extension.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

ksh in vi mode, choose from output

is there a way to choose the complement from the output from the sequense in "ksh -o vi" root# ls testa testb root# cat tes 1) testa 2) testb root# cat tes <-- what to do now? this output looks like a select function, otherwise the numbers wouldn't make sense, is there a chance to use... (2 Replies)
Discussion started by: pressy
2 Replies

2. UNIX for Dummies Questions & Answers

Let statement in ksh HELP

I have: datafile contains 1234567890 >wc -c datafile | awk '{print $1}' >11 The program #!/bin/ksh let n = (wc -c datafile | awk '{print $1}') echo $n I expect n to be 11 but it gives error message. What is wrong with this statement? Thanks! (3 Replies)
Discussion started by: bobo
3 Replies

3. Shell Programming and Scripting

nawk/ksh help

Hello, First of all, I am trying to duplicate the sum command using ksh/nawk Lets assume the following algorithms work just fine and there is no calculation errors what so ever (which I doubt at this minute). For now, I wanna make sure the script uses the BSD algorithim if -r is used... (0 Replies)
Discussion started by: DeltaX
0 Replies

4. Shell Programming and Scripting

I can't seem to pass variables properly into a nawk statement

Ok, So up front I'm going to say that I'm a very elementary scripter, and I tend to use tools I don't fully understand, but I shotgun at something until I can get it to work...that said, I can't for the life of me understand why I can't get this to go down the way I want it to. The goal: -to... (6 Replies)
Discussion started by: DeCoTwc
6 Replies

5. UNIX for Dummies Questions & Answers

Arrays in nawk and ksh

I'm not confident at all on how arrays work. I want to know how to set arrays in ksh and in nawk (is there a difference??) if someone can show me some examples of both that will be great. Tried to look up on the net but was confusing me more. Any help would be appreciated. (2 Replies)
Discussion started by: Pablo_beezo
2 Replies

6. Shell Programming and Scripting

nawk: illegal statement at source line 1

Hello Everyone, I don't know what is wrong with this: Is it that nawk cannot run a ".sh" script or is it not treating "." as a literal. If so how to make "." be treated as a literal in "nawk" statemnts? Thanks in Advance (2 Replies)
Discussion started by: bhaire
2 Replies

7. AIX

can't parse this nawk statement

hi all i have the following portion in an xml file: </n:AOMessage> <?xml version="1.0" encoding="UTF-8"?> <n:AOMessage xmlns:n="urn:ao:hs:update:shell" xmlns:bo="urn:ao:hs" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="urn:ao:hs:update:shell... (0 Replies)
Discussion started by: chipahoys
0 Replies

8. Shell Programming and Scripting

awk or nawk in ksh

I am trying to use either awk or nawk in ksh88 to grep the word "Reason" in multiple files and than print the lines that say "Reason" in a particular format that is different from how they would normally print. The original input is as follows: ... (10 Replies)
Discussion started by: ther2000
10 Replies

9. Shell Programming and Scripting

How to get user to choose files to be copied to FTP server?

Hey all. I'm writing a script to automatically login to a router, change directories to where crashfiles are located, then listing all files in that directory. This is where I'm at so far and wish to have some user interaction to choose the files. What I am trying to do is list the files and get... (1 Reply)
Discussion started by: Gouda
1 Replies
RATFOR(1)						      General Commands Manual							 RATFOR(1)

NAME
ratfor - rational Fortran dialect SYNOPSIS
ratfor [ option ... ] [ filename ... ] DESCRIPTION
Ratfor converts a rational dialect of Fortran into ordinary irrational Fortran. Ratfor provides control flow constructs essentially iden- tical to those in C: statement grouping: { statement; statement; statement } decision-making: if (condition) statement [ else statement ] switch (integer value) { case integer: statement ... [ default: ] statement } loops: while (condition) statement for (expression; condition; expression) statement do limits statement repeat statement [ until (condition) ] break next and some syntactic sugar to make programs easier to read and write: free form input: multiple statements/line; automatic continuation comments: # this is a comment translation of relationals: >, >=, etc., become .GT., .GE., etc. return (expression) returns expression to caller from function define: define name replacement include: include filename Ratfor is best used with f77(1). SEE ALSO
f77(1) B. W. Kernighan and P. J. Plauger, Software Tools, Addison-Wesley, 1976. 7th Edition April 29, 1985 RATFOR(1)
All times are GMT -4. The time now is 06:29 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy