Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Calling z by itself causes an error #1

Closed
adambair opened this issue Jul 1, 2009 · 3 comments
Closed

Calling z by itself causes an error #1

adambair opened this issue Jul 1, 2009 · 3 comments

Comments

@adambair
Copy link

adambair commented Jul 1, 2009

On my system (OS X 10.5.7) calling z without arguments results in the errors below. Everything else seems to work as expected.

    → z
    awk: syntax error at source line 36
     context is
    print $0 >> FILENAME >>>  ".tmp" <<< 
    awk: illegal statement at source line 37
    awk: illegal statement at source line 37
    mv: rename /Users/adam/.z.tmp to /Users/adam/.z: No such file or directory
@rupa
Copy link
Owner

rupa commented Jul 2, 2009

Thanks, it looks like some versions of awk don't like the FILENAME variable. I'll look at this on a mac and try to fix. I'm surprised that other stuff still works, cause this looks like it would zero out your datafile.

@adambair
Copy link
Author

adambair commented Jul 2, 2009

Hrm, I think you're right... it worked for a while until I ran it without the arguments -- then it looks like it did zero out my data file :)

@rupa
Copy link
Owner

rupa commented Jul 2, 2009

pass tmpfile name to awk in a variable. BSD awk (which OSX appears to use) doesn't like to redirect to concatenated filenames, and FILENAME is not available in the BEGIN clause, which is where i'd like to concatenate it, so this seemed the best approach. Closed by eacb0e8

shmup pushed a commit to shmup/z that referenced this issue Sep 4, 2022
… use) doesn't like to redirect to concatenated filenames, and FILENAME is not available in the BEGIN clause, which is where i'd like to concatenate it, so this seemed the best approach. Closes rupagh-1
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants