Sponsored Content
Top Forums Shell Programming and Scripting AIX to RHEL migration - awk treating 0e[0-9]+ as 0 instead of string issue Post 302997463 by RudiC on Sunday 14th of May 2017 03:26:24 AM
Old 05-14-2017
As I said - usage alone, be it for assignment or reference in an index, takes the value as is. Only evaluation, e.g. for a boolean expression or a numerical computation, converts the string to a number, using the starting characters up to a non-convertible one.
This User Gave Thanks to RudiC For This Post:
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

AIX Migration

Hi , Migrating AIX 4.3.3 ML10 to 5.3 ML1 (retaining 32 bit) after successfully going through 5 of the 5.3 Install CD's. After "All fileset's processed successfully " message I was told that system would reboot and then I would get prompted for setting TERm type ( i have an ascii ibm3151) and... (1 Reply)
Discussion started by: Student37
1 Replies

2. Shell Programming and Scripting

awk issue on AIX

Hi, two teams at two locations - A & B. At location A, we have AIX 5.3 and at location B, we have AIX 5.1. We execute the below awk command in loc A and it executes successfully(part of a larger script). But the same does not get executed in the loc B server. We are not able to access the loc B... (1 Reply)
Discussion started by: ranj@chn
1 Replies

3. AIX

AIX 5.2 to 5.3 migration

Hello All, We want to upgrade our 44p Model 270 from AIX 5.2 to 5.3. This is a standalone devlopment server but downtime is something we don't want because we have a short development deadline looming. I have no tape drive to make backups to. I myself am a developer and don't have any... (4 Replies)
Discussion started by: Fred Vogel
4 Replies

4. AIX

IY17981 fix required for aix 4.3.3 to aix 5L migration but not found

Hi, redbook documentation is telling that IY17981 fix is required for aix 4.3.3 to aix 5L migration. But there is no mention about that fix in any ML installation packages. - My system is ML11 : oslevel –r 4330-11 - But xlC.rte is on wrong version : lslpp -L xlC.rte xlC.rte ... (3 Replies)
Discussion started by: astjen
3 Replies

5. Shell Programming and Scripting

Treating string as date ?

Is there a way to treat a string as date and compare it to the current date? lets assum inpu lik $ cat myfile Name Last login ************************** Sara 2/13/2012 kalpeer 2/15/2012 ygemici 2/14/2012 we want to display the name who logged in during the last #... (4 Replies)
Discussion started by: Sara_84
4 Replies

6. Shell Programming and Scripting

awk - treating remaining columns as one

Hi all, For no particular reason, I would like to use awk on a file that contains multiple columns, but let's say only columns 1 and 2 have some text values, and the remainder of the line contains text that I would like to treat as one column, considering I have spaces as delimiter for the... (33 Replies)
Discussion started by: ppucci
33 Replies

7. Shell Programming and Scripting

Search several string and convert into a single line for each search string using awk command AIX?.

I need to search the file using strings "Request Type" , " Request Method" , "Response Type" and by using result set find the xml tags and convert into a single line?. below are the scenarios. Cat test Nov 10, 2012 5:17:53 AM INFO: Request Type Line 1.... (5 Replies)
Discussion started by: laknar
5 Replies

8. AIX

AIX - FC Switch migration, SAN Migration question!

I'm New to AIX / VIOS We're doing a FC switch cutover on an ibm device, connected via SAN. How do I tell if one path to my remote disk is lost? (aix lvm) How do I tell when my link is down on my HBA port? Appreciate your help, very much! (4 Replies)
Discussion started by: BG_JrAdmin
4 Replies

9. AIX

AIX Migration issue with EMC ODM sets

Hi Experts , I want to start migrating our AIX 6.1 to AIX 7.1 . I am planning to use alt_disk_migration . Chris gibson has awesome documentation in the internet. However I am running into an issue with EMC odm filesets . So my current OS is AIX 6.1. and I have this : lslpp -l | grep EMC ... (7 Replies)
Discussion started by: JME2015
7 Replies

10. Shell Programming and Scripting

awk treating variables differently in UNIX-Linux

Hi, awk seem to be acting differently in Unix and Linux when it comes to formatting. This is making it difficult to migrate scripts. for example: UNIX: echo "123" |awk '{printf ("%05s\n" ,$1)}' 00123 echo "123" |awk '{printf ("%05d\n" ,$1)}' 00123 echo "S12" |awk '{printf ("%05s\n"... (9 Replies)
Discussion started by: wanderingmind16
9 Replies
BAS(1)							      General Commands Manual							    BAS(1)

NAME
bas - basic SYNOPSIS
bas [ file ] DESCRIPTION
Bas is a dialect of Basic. If a file argument is provided, the file is used for input before the terminal is read. Bas accepts lines of the form: statement integer statement Integer numbered statements (known as internal statements) are stored for later execution. They are stored in sorted ascending order. Non-numbered statements are immediately executed. The result of an immediate expression statement (that does not have `=' as its highest operator) is printed. Interrupts suspend computation. Statements have the following syntax: expression The expression is executed for its side effects (assignment or function call) or for printing as described above. comment This statement is ignored. It is used to interject commentary in a program. done Return to system level. dump The name and current value of every variable is printed. edit The UNIX editor, ed, is invoked with the file argument. After the editor exits, this file is recompiled. for name = expression expression statement for name = expression expression next The for statement repetitively executes a statement (first form) or a group of statements (second form) under control of a named vari- able. The variable takes on the value of the first expression, then is incremented by one on each loop, not to exceed the value of the second expression. goto expression The expression is evaluated, truncated to an integer and execution goes to the corresponding integer numbered statment. If executed from immediate mode, the internal statements are compiled first. if expression statement if expression [ else fi The statement (first form) or group of statements (second form) is executed if the expression evaluates to non-zero. In the second form, an optional else allows for a group of statements to be executed when the first group is not. list [expression [expression]] is used to print out the stored internal statements. If no arguments are given, all internal statements are printed. If one argument is given, only that internal statement is listed. If two arguments are given, all internal statements inclusively between the argu- ments are printed. print list The list of expressions and strings are concatenated and printed. (A string is delimited by " characters.) prompt list Prompt is the same as print except that no newline character is printed. return [expression] The expression is evaluated and the result is passed back as the value of a function call. If no expression is given, zero is returned. run The internal statements are compiled. The symbol table is re-initialized. The random number generator is reset. Control is passed to the lowest numbered internal statement. save [expression [expression]] Save is like list except that the output is written on the file argument. If no argument is given on the command, b.out is used. Expressions have the following syntax: name A name is used to specify a variable. Names are composed of a letter followed by letters and digits. The first four characters of a name are significant. number A number is used to represent a constant value. A number is written in Fortran style, and contains digits, an optional decimal point, and possibly a scale factor consisting of an e followed by a possibly signed exponent. ( expression ) Parentheses are used to alter normal order of evaluation. _ expression The result is the negation of the expression. expression operator expression Common functions of two arguments are abbreviated by the two arguments separated by an operator denoting the function. A complete list of operators is given below. expression ( [expression [ , expression] ... ] ) Functions of an arbitrary number of arguments can be called by an expression followed by the arguments in parentheses separated by commas. The expression evaluates to the line number of the entry of the function in the internally stored statements. This causes the internal statements to be compiled. If the expression evaluates negative, a builtin function is called. The list of builtin functions appears below. name [ expression [ , expression ] ... ] Each expression is truncated to an integer and used as a specifier for the name. The result is syntactically identical to a name. a[1,2] is the same as a[1][2]. The truncated expressions are restricted to values between 0 and 32767. The following is the list of operators: = = is the assignment operator. The left operand must be a name or an array element. The result is the right operand. Assignment binds right to left, & | & (logical and) has result zero if either of its arguments are zero. It has result one if both its arguments are non-zero. | (log- ical or) has result zero if both of its arguments are zero. It has result one if either of its arguments are non-zero. < <= > >= == <> The relational operators (< less than, <= less than or equal, > greater than, >= greater than or equal, == equal to, <> not equal to) return one if their arguments are in the specified relation. They return zero otherwise. Relational operators at the same level extend as follows: a>b>c is the same as a>b&b>c. + - Add and subtract. * / Multiply and divide. ^ Exponentiation. The following is a list of builtin functions: arg(i) is the value of the i -th actual parameter on the current level of function call. exp(x) is the exponential function of x. log(x) is the natural logarithm of x. sqr(x) is the square root of x. sin(x) is the sine of x (radians). cos(x) is the cosine of x (radians). atn(x) is the arctangent of x. Its value is between -n/2 and n/2. rnd( ) is a uniformly distributed random number between zero and one. expr( ) is the only form of program input. A line is read from the input and evaluated as an expression. The resultant value is returned. abs(x) is the absolute value of x. int(x) returns x truncated (towards 0) to an integer. FILES
/tmp/btm? temporary b.out save file /bin/ed for edit DIAGNOSTICS
Syntax errors cause the incorrect line to be typed with an underscore where the parse failed. All other diagnostics are self explanatory. BUGS
Has been known to give core images. Catches interrupts even when they are turned off. BAS(1)
All times are GMT -4. The time now is 09:38 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy