Sponsored Content
Top Forums Shell Programming and Scripting pass shell parameters to awk does not work Post 302532289 by alan on Monday 20th of June 2011 12:36:56 PM
Old 06-20-2011
Cool. I changed to a while loop and fed $myfile to the awk command. It worked. Thank you.
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to pass Shell variables to sqlplus use them as parameters

Hi, I am trying to pass some of the variables in my shell scripts to the sqlplus call and use them as parameters. For example, I would like to replace the 'SAS', and '20050612' with $var1 and $var2, respectively, how can I do that? --------------------------------------------------------... (1 Reply)
Discussion started by: Jtrinh
1 Replies

2. UNIX for Dummies Questions & Answers

How to pass two or more parameters to the main in shell script

Hey Guys from the below script what I understood is we are sending the the first parameter as input to the main (){} file main > $LOGFILE 2>&1 but can we send two or three parameter as input to this main file as main > $LOGFILE 2>&1 2>&2 like this Can any one plz help I need to writ a... (0 Replies)
Discussion started by: pinky
0 Replies

3. Shell Programming and Scripting

How to pass parameters to an awk file?

I have an awk file where I need to pass a filename and a value as a parameter from a sh script. I need to know how to pass those values in the sh script and how to use the same in the awk file. Thanks in advance!!! Geetha (3 Replies)
Discussion started by: iamgeethuj
3 Replies

4. Shell Programming and Scripting

want to pass parameters to awk script from shell script

Hello, I have this awk script that I want to execute by passing parameters through a shell script. I'm a little confused. This awk script removes duplicates from an input file. Ok, so I have a .sh file called rem_dups.sh #!/usr/bin/sh... (4 Replies)
Discussion started by: script_op2a
4 Replies

5. Shell Programming and Scripting

need to pass parameters to working and tested awk script

I have a working and tested AWK script that removes duplicates from an input file and generates an output file without the duplicates. I had help from my other post to develop it: ... (3 Replies)
Discussion started by: script_op2a
3 Replies

6. Shell Programming and Scripting

call another shell script and pass parameters to that shell script

Hi, I basically have 2 shell scripts. One is a shell script will get the variable value from the user. The variable is nothing but the IP of the remote system. Another shell script is a script that does the job of connecting to the remote system using ssh. This uses a expect utility in turn. ... (2 Replies)
Discussion started by: sunrexstar
2 Replies

7. Shell Programming and Scripting

Can't get shell parameters to pass properly to sqlplus

Gurus, The issue I'm having is that my Shell won't accept SQL parameters properly...... Here's they way I'm running it.... applmgr@ga006hds => sh CW_MigrationDeployScript.sh apps <appspwd> <SID> '01-JAN' '31-MAR' The process just hangs not submitting the SQL job... ... (3 Replies)
Discussion started by: WhoDatWhoDer
3 Replies

8. Emergency UNIX and Linux Support

Pass two parameters

Hi I have a batch file aaa.exe which needs two input parameters: Usually the command's format likes aaa 555 10000 But I want to use parameters to do it. aaa $1 $2 These two parameters come from a text file list.txt 41800497 41801375 41814783 41816135 41814930 41816135 41819987 41820843... (4 Replies)
Discussion started by: zhshqzyc
4 Replies

9. Shell Programming and Scripting

Pass Parameters to awk command

I need to pass values at runtime for the below awk command where l is the length and partial.txt is the file name. awk -v l=285 '{s="%-"l"s\n";printf(s,$0);}' partial.txt > temp1.txt; (5 Replies)
Discussion started by: Amrutha24
5 Replies

10. UNIX for Dummies Questions & Answers

Pass shell Variable to awk

Hello, May i please know how do i pass the shell variable to awk expression in the below script. It is returning null #!/bin/bash UNINUM=720922 UNINUM_DESC=`awk -F'|' -v UNINUM=$2 '/UNINUM/ {print $4}' datafile` echo $UNINUM_DESC datafile 4|First|720194|asdasdad 4|First|720735|asdasdsa... (8 Replies)
Discussion started by: Ariean
8 Replies
replacekey(1)						      General Commands Manual						     replacekey(1)

NAME
replacekey - replace keywords in a FITS header SYNOPSIS
replacekey [options] <in> DESCRIPTION
replacekey is aimed at replacing keywords in a FITS file's header by new keywords provided by the user on the command-line. ALGORITHM
The user can provide a new_keyword, an old_keyword, a value and a comment. first searchs for old_keyword if provided. If it finds it, it replaces the associated card by the new one (new_keyword=value/comment). If old_keyword is either not found or not provided, associated card by the new one (new_keyword=value/comment). new_keyword has to be provided. Examples: You want to change the value of VALUE from 32 to 16 in myfile.fits: % replacekey -k "VALUE" -v "16" myfile.fits If you want to replace the card with the keyword OLD by "NEW = 3.14 / This is a usefull key" in myfile.fits: % replacekey -k "NEW" -v "3.14" -c "This is a usefull key" -K "OLD" myfile.fits If your do not care about the HISTORY cards you have in the header, and want to replace the first one by VALUE=32, you would do: % replacekey -k "VALUE" -v "32" -K "HISTORY" myfile.fits OPTIONS
-k or --key key To provide the new keyword. -K or --old key To provide the old keyword. -v or --val val To provide the new value. -c or --com com To provide the new comment. SEE ALSO
hierarch28 to convert HIERARCH ESO keywords to regular 8-char keywords. FILES
Files shall all comply with FITS format BUGS
Modifications are so far only possible in the main header, not in the extensions. 28 Oct 1999 replacekey(1)
All times are GMT -4. The time now is 03:12 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy