Show Password

Admin Notice

Shell Programming and Scripting

BSD, Linux, and UNIX shell scripting — Post awk, bash, csh, ksh, perl, php, python, sed, sh, shell scripts, and other shell scripting languages questions here.

My awk executable is not printing FILENAME...: why?

Shell Programming and Scripting

Thread Tools Search this Thread Display Modes
Old 4 Weeks Ago
fbird3 fbird3 is offline
Registered User
Join Date: Jun 2018
Last Activity: 13 June 2018, 4:05 PM EDT
Posts: 6
Thanks: 2
Thanked 0 Times in 0 Posts
My awk executable is not printing FILENAME...: why?

Hello, there!

I am running an executable awk script with 'source.awk input_file' and found that when I need to print FILENAME, or ENVIRON["AWKPATH"] or even FNR nothing happens [except for an empty line]...
However, if I run it with 'awk -f source.awk input_file', then those variables are printed...
What is the reason for that behaviour?
Thanking you in advance.
Sponsored Links
Old 4 Weeks Ago
RudiC RudiC is offline Forum Staff  
Join Date: Jul 2012
Last Activity: 15 July 2018, 3:56 PM EDT
Location: Aachen, Germany
Posts: 13,051
Thanks: 444
Thanked 4,006 Times in 3,683 Posts
Duplicate of My awk executable is not printing FILENAME...: why?.
The Following User Says Thank You to RudiC For This Useful Post:
fbird3 (4 Weeks Ago)
Sponsored Links

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
My awk executable is not printing FILENAME...: why? fbird3 Shell Programming and Scripting 6 4 Weeks Ago 03:54 PM
Issue when printing filename through cygwin using a variable with awk alvinoo Shell Programming and Scripting 1 06-17-2015 10:44 PM
Command - filename as arguments - make executable to all users. Reddax UNIX for Dummies Questions & Answers 3 11-05-2014 09:09 AM
fgrep - printing pattern and filename yoda9691 UNIX for Advanced & Expert Users 1 06-03-2011 05:29 PM
Help with printing the calling script filename frozensmilz Shell Programming and Scripting 2 08-10-2010 10:09 PM

All times are GMT -4. The time now is 02:31 AM.

Unix & Linux Forums Content Copyright©1993-2018. All Rights Reserved.