Sponsored Content
Full Discussion: Passing Variables to AWK
Top Forums Shell Programming and Scripting Passing Variables to AWK Post 14140 by thehoghunter on Monday 28th of January 2002 05:23:15 PM
Old 01-28-2002
You already said it:The following scripts runs fine on IRIX64 6.5 but has bugs on Solaris 8.

Two companies building different varients of UNIX. There is probably something different in the way it's testing - is IRIX BSD based or System V? Solaris is a mix of the two (leaning more towards System V). It's not uncommon for ANY software to be a bit different. Double check that your code can be ported - that it isn't OS dependent (stated this since the test you spoke of isn't here so I can not help with it).
thehoghunter
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Passing Variables to Awk

Hi I have a unix shell script with an awk statement. I would like to print some of the fields of an input file. However, I would like to print them dynamically, ie by passing the literal $1 $3 into the script to define the output. I have tried the following: variable1='$1' awk... (2 Replies)
Discussion started by: Bab00shka
2 Replies

2. Shell Programming and Scripting

Passing awk Variables

I am trying to pass the results from a variable gathered from awk, however when I echo the 'PARSE' and 'SUB', the response is blank. This is my command. awk -F= '/Unit/''{ PARSE=substr($2,1,5) ; SUB=substr($2,1,1) }' inputfile.lst Is this a kind of valid attempt or am I obligated to declare... (3 Replies)
Discussion started by: gozer13
3 Replies

3. Shell Programming and Scripting

Passing space seprated variables in awk

Hi, How to pass space seprated variables in awk. (HP-UX, sh shell) I have the problem like below: var="Hello" var2="Manu Batham" echo $var2 | awk -v variable=${var} '{ printf "%s %s", variable, $1}' and its output is: Hello Manu while output should be: Hello Manu Batham Please... (4 Replies)
Discussion started by: manubatham20
4 Replies

4. Shell Programming and Scripting

Passing awk variables to shell

Hi. I need to parse file and assign some values to variables, right now i do like below MYHOMEDIR=`awk '/Home/ {print $NF}' output.txt` MYSHELL=`awk '/Shell/ {print $NF}' output.txt` PRGRP=`awk '/Primary/ {print $NF}' output.txt` SECGRP=`awk '/Second/ {print $NF}' output.txt` In this... (10 Replies)
Discussion started by: urello
10 Replies

5. Shell Programming and Scripting

ksh passing to awk multiple dyanamic variables awk -v

Using ksh to call a function which has awk script embedded. It parses a long two element list file, filled with text numbers (I want column 2, beginning no sooner than line 45, that's the only known thing) . It's unknown where to start or end the data collection, dynamic variables will be used. ... (1 Reply)
Discussion started by: highnthemnts
1 Replies

6. Shell Programming and Scripting

Passing variables into AWK

I'm trying to use awk to write new entries to a hosts file if they don't exist. I need to do so depending on the type of system I have. Below is what I have, but it isn't working. awk -v myip1=$IP1 myip2=$IP2 myhost1=$HOST1 myhost2=$HOST2' BEGIN { mqhost1=0; mqhost2=0; stap1=0; stap2=0; } ... (4 Replies)
Discussion started by: Boomn4x4
4 Replies

7. Shell Programming and Scripting

PAssing variables to awk arithmetic

Hi all, I am wanting to pass variables from a file to an awk arithmetic formula. When I use the formula with the value it works well. As soon as I make these variables I get an inf (infinity) response. I can certainly echo the variables back and they look correct. My googling for answers has... (3 Replies)
Discussion started by: gafoleyo73
3 Replies

8. Shell Programming and Scripting

Passing variables to awk

Hi guys, I need to fetch data from logfile between two given dates,i got the below code from our forum.It works perfect,but i need to enter the value dynamically to awk while running. awk '/2012 Jun/{p=1}!/2012 Jul/ && prev~/2012 Jul/ && p{p=0}{prev=$0}p' file i tried the below code,but... (4 Replies)
Discussion started by: mohanalakshmi
4 Replies

9. Shell Programming and Scripting

Passing awk variables to bash variables

Trying to do so echo "111:222:333" |awk -F: '{system("export TESTO=" $2)}'But it doesn't work (2 Replies)
Discussion started by: urello
2 Replies

10. Shell Programming and Scripting

awk - passing variables in and out

Am looking to pass some Linux environment variables into AWK , can I simply use the -v option ? awk -F: -v AHOME=$HOME '{ if {rm AHOME/file.txt a=2 } }' config.txt ... (4 Replies)
Discussion started by: alldbest
4 Replies
grub(5) 						Standards, Environments, and Macros						   grub(5)

NAME
grub - GRand Unified Bootloader software on Solaris DESCRIPTION
The current release of the Solaris operating system is shipped with the GRUB (GRand Unified Bootloader) software. GRUB is developed and supported by the Free Software Foundation. The overview for the GRUB Manual, accessible at www.gnu.org, describes GRUB: Briefly, a boot loader is the first software program that runs when a computer starts. It is responsible for loading and transferring con- trol to an operating system kernel software (such as Linux or GNU Mach). The kernel, in turn, initializes the rest of the operating system (for example, a GNU [Ed. note: or Solaris] system). GNU GRUB is a very powerful boot loader that can load a wide variety of free, as well as proprietary, operating systems, by means of chain- loading. GRUB is designed to address the complexity of booting a personal computer; both the program and this manual are tightly bound to that computer platform, although porting to other platforms may be addressed in the future. [Ed. note: Sun has ported GRUB to the Solaris operating system.] One of the important features in GRUB is flexibility; GRUB understands filesystems and kernel executable formats, so you can load an arbi- trary operating system the way you like, without recording the physical position of your kernel on the disk. Thus you can load the kernel just by specifying its file name and the drive and partition where the kernel resides. Among Solaris machines, GRUB is supported on x86 platforms. The GRUB software that is shipped with Solaris adds two utilities not present in the open-source distribution: bootadm(1M) Enables you to manage the boot archive and make changes to the GRUB menu. installgrub(1M) Loads the boot program from disk. Both of these utilities are described in Solaris man pages. Beyond these two Solaris-specific utilities, the GRUB software is described in the GRUB manual, a PDF version of which is available from the Sun web site. Available in the same location is the grub(8) open-source man page. This man page describes the GRUB shell. SEE ALSO
boot(1M), bootadm(1M), installgrub(1M) Solaris Express Installation Guide: Basic Installations System Administration Guide: Basic Administration http://www.gnu.org/software/grub SunOS 5.11 21 Apr 2005 grub(5)
All times are GMT -4. The time now is 02:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy