Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Issue with variable within a loop Post 302969419 by Aia on Tuesday 22nd of March 2016 01:32:48 PM
Old 03-22-2016
Let's start by pointing out the way you can introduce shell variables to AWK.
Code:
# shell variable
var="value"

# pass $var to AWK and use
awk -v label="$var" '{print label}'

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Help With A For Loop Issue

I was wondering how I can modify this for loop, so it only loops through the filenames that do not have an ".old" extension. for filename in $(ls "$1") do echo $filename | grep '\.old$' > /dev/null if then mv $1/$filename $1/$filename.old fi done (5 Replies)
Discussion started by: ralts01
5 Replies

2. Shell Programming and Scripting

until loop issue.

Hi, my script is waiting for 3 files to come to a folder for 30 min but even when all the files arrive in the folder it's still waiting for these three files. Files can come with in 2 min and I want it to start processing them immediately after all the files arrive in the folder. until ; do... (3 Replies)
Discussion started by: gurpartap
3 Replies

3. Shell Programming and Scripting

Issue with using While loop

Hi, I am trying to move a file from remote server to local server and when the transfer completes successfully i call a script in remote server to remove the file which was successfully transferred. I do this by first getting the list of file in remote server and move the text file to local... (8 Replies)
Discussion started by: funonnet
8 Replies

4. Shell Programming and Scripting

[SHELL: /bin/sh] For loop using variable variable names

Simple enough problem I think, I just can't seem to get it right. The below doesn't work as intended, it's just a function defined in a much larger script: CheckValues() { for field in \ Group_ID \ Group_Title \ Rule_ID \ Rule_Severity \ ... (2 Replies)
Discussion started by: Vryali
2 Replies

5. Shell Programming and Scripting

printing variable with variable suffix through loop

I have a group of variables myLINEcnt1 - myLINEcnt10. I'm trying to printout the values using a for loop. I am at the head banging stage since i'm sure it has to be a basic syntax issue that i can't figure out. For myIPgrp in 1 2 3 4 5 6 7 8 9 10; do here i want to output the value of... (4 Replies)
Discussion started by: oly_r
4 Replies

6. UNIX for Dummies Questions & Answers

Loop and variable not exactly variable: what's wrong

Hello guys, This truly is a newbie question. I'm trying to make a loop to execute simultaneous commands indefinitely while using variable. Here is how my mess looks like (this is just an example): #!/bin/bash IP=`shuf -n 1 IP.txt` # I figured this would be easier to select random lines... (4 Replies)
Discussion started by: bobylapointe
4 Replies

7. Shell Programming and Scripting

Array Variable being Assigned Values in Loop, But Gone when Loop Completes???

Hello All, Maybe I'm Missing something here but I have NOOO idea what the heck is going on with this....? I have a Variable that contains a PATTERN of what I'm considering "Illegal Characters". So what I'm doing is looping through a string containing some of these "Illegal Characters". Now... (5 Replies)
Discussion started by: mrm5102
5 Replies

8. Shell Programming and Scripting

[Solved] How to increment and add variable length numbers to a variable in a loop?

Hi All, I have a file which has hundred of records with fixed number of fields. In each record there is set of 8 characters which represent the duration of that activity. I want to sum up the duration present in all the records for a report. The problem is the duration changes per record so I... (5 Replies)
Discussion started by: danish0909
5 Replies

9. Shell Programming and Scripting

Variable value substitution issue with awk command issue

Hi All, I am using the below script which has awk command, but it is not returing the expected result. can some pls help me to correct the command. The below script sample.ksh should give the result if the value of last 4 digits in the variable NM matches with the variable value DAT. The... (7 Replies)
Discussion started by: G.K.K
7 Replies

10. Shell Programming and Scripting

While Loop issue

Hi, i=0 t5=6000001 while do i=`expr $i + 1` t5=`expr $t5 + 1` echo $t5 done I am able to increment "col3" value but unable to get col1,col2 value. Input: t1=10001 t2=abc t3=ghkc (5 Replies)
Discussion started by: onesuri
5 Replies
GRUB-MKRESCUE(3)					     Library Functions Manual						  GRUB-MKRESCUE(3)

NAME
grub-mkrescue -- Generate a GRUB rescue image using GNU Xorriso. SYNOPSIS
grub-mkrescue [-o | --output=FILE] [--modules=MODULES] [--install-modules=MODULES] [--themes=THEMES] [--fonts=FONTS] [--locales=LOCALES] [--compress[=no,xz,gz,lzo]] [-d | --directory=DIR] [--grub-mkimage=FILE] [--rom-directory=DIR] [--xorriso=FILE] [--grub-glue-efi=FILE] [--grub-render-label=FILE] [--label-font=FILE] [--label-color=COLOR] [--label-bgcolor=FILE] [--product-name=STRING] [--product-version=STRING] [--sparc-boot] [--arcs-boot] DESCRIPTION
grub-mkrescue can be used to generate a rescue image with the GRUB bootloader. OPTIONS
--output=FILE Write the generated file to FILE. The default is to write to standard output. --modules=MODULES Pre-load modules specified by MODULES. --install-modules=MODULES Install only MODULES and their dependencies. The default is to install all available modules. --themes=THEMES Install THEMES. The default is to install the starfield theme, if available. --fonts=FONTS Install FONTS. The default is to install the unicode font. --locales=LOCALES Install only locales listed in LOCALES. The default is to install all available locales. --compress[=no,xz,gz,lzo] Compress GRUB files using the specified compression algorithm. --directory=DIR Use images and modules in DIR. --grub-mkimage=FILE Use FILE as grub-mkimage(1). The default is /usr/bin/grub-mkimage. --rom-directory=DIR Save ROM images in DIR. --xorriso=FILE Use FILE as xorriso. --grub-glue-efi=FILE Use FILE as grub-glue-efi(3). --grub-render-label=FILE Use FILE as grub-render-label(3). --label-font=FILE Use FILE as the font file for generated labels. --label-color=COLOR Use COLOR as the color for generated labels. --label-bgcolor=COLOR Use COLOR as the background color for generated labels. --product-name=STRING Use STRING as the product name in generated labels. --product-version=STRING Use STRING as the product version in generated labels. --sparc-boot Enable booting the SPARC platform. This disables HFS+, APM, ARCS, and "boot as disk image" on the i386-pc target platform. --arcs-boot Enable ARCS booting. This is typically for big-endian MIPS machines, and disables HFS+, APM, sparc64, and "boot as disk image" on the i386-pc target platform. -- All options after a -- will be passed directly to xorriso's command line when generating the image. SEE ALSO
info grub Wed Feb 26 2014 GRUB-MKRESCUE(3)
All times are GMT -4. The time now is 07:26 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy