The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
Google UNIX.COM


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
gawk and gensub ripat Shell Programming and Scripting 2 05-10-2008 12:20 PM
awk,gawk in bat file andrej Shell Programming and Scripting 0 05-09-2008 05:45 AM
gawk and strftime() ripat Shell Programming and Scripting 2 05-07-2008 11:30 AM
gawk HELP sandeep_hi Shell Programming and Scripting 6 06-19-2006 05:56 AM
rs and ors in gawk ...???? moxxx68 Shell Programming and Scripting 2 10-05-2004 09:52 AM

Reply
 
Submit Tools LinkBack Thread Tools Display Modes
  #1 (permalink)  
Old 02-10-2005
Registered User
 

Join Date: Feb 2005
Posts: 52
starting gawk from env

Hi!

This is my first post here - regards!

I wrote gawk script with the first line:

#!/usr/bin/env gawk -f

but it does not work. Why?
Probably env is trying to exec "gawk -f" instead of "gawk".

I am also using env to start wish and there are no problems.

Thanks
Reply With Quote
Forum Sponsor
  #2 (permalink)  
Old 02-15-2005
RTM's Avatar
RTM RTM is offline
Hog Hunter
 
Join Date: Apr 2002
Location: On my motorcycle
Posts: 3,039
You may need to tell it to ignore the -f by either quoting or using \-f
Reply With Quote
  #3 (permalink)  
Old 02-16-2005
Registered User
 

Join Date: Feb 2005
Posts: 52
Thanks, but it does not help...
I obtained:

/usr/bin/env: gawk '-f': No such file or directory

I cannot see logical reason for:
#!/usr/bin/env gawk -f
wrong operation. Maybe a bug...

Regards
Reply With Quote
  #4 (permalink)  
Old 02-16-2005
vgersh99's Avatar
Moderator
 

Join Date: Feb 2005
Location: Boston, MA
Posts: 3,002
FYI:

shebang with env and options
Reply With Quote
  #5 (permalink)  
Old 02-16-2005
Registered User
 

Join Date: Jan 2005
Posts: 97
Quote:
Originally Posted by odys
Hi!

This is my first post here - regards!

I wrote gawk script with the first line:

#!/usr/bin/env gawk -f

Thanks
try this:

#! /usr/bin/env gawk -f
Reply With Quote
  #6 (permalink)  
Old 02-16-2005
Perderabo's Avatar
Unix Daemon
 

Join Date: Aug 2001
Location: Washington DC Area
Posts: 8,466
Quote:
Originally Posted by thumsup9
try this:

#! /usr/bin/env gawk -f
Don't bother trying that, it won't work either. Read the link that vgersh99 posted.
Reply With Quote
  #7 (permalink)  
Old 02-16-2005
Registered User
 

Join Date: Feb 2005
Posts: 52
Thanks folks!

Switching to
#!/bin/sh
seems to be good idea in order to obtain portability.

Regards
Reply With Quote
Google The UNIX and Linux Forums
Reply

Thread Tools
Display Modes




All times are GMT -7. The time now is 01:10 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Global Fact Book

Content Relevant URLs by vBSEO 3.2.0