Can't use awk in terminal

0

1

I want to use awk command to do something, I input awk in terminal, but the terminal show me that

awk: cannot open /home/user/myexe/external_symbols.awk (No such file or directory)

Someone tell to make an alias in your shell,but I would not ..,can someone help me..

Then I try to input :which -a awk

terminal show :/usr/bin/awk

input: type awk

terminal show: awk is aliased to 'awk -f /home/user/myexe/external_symbols.awk' How can i change the aliase which path?

choujayyl

Posted 2013-01-21T01:30:04.087

Reputation: 3

Answers

3

Type unalias awk at the command line to remove the alias.

Jakob Weisblat

Posted 2013-01-21T01:30:04.087

Reputation: 926

1As said, unalias awk will work in the current terminal. Also check your ~/.bashrc file. Look for a line that sets the awk alias. You can remove that line. – Matt – 2013-01-21T02:05:24.663

@Jake223 I remove the alias,then do I need to set something or without ? – choujayyl – 2013-01-21T02:43:40.140

I don't understand your question. If you're asking about what Matt said, bring up a file called /home/yourusername/.bashrc in your favorite text editor and look for a line that stars with alias awk=.... delete that line. – Jakob Weisblat – 2013-01-21T02:49:37.220

@Jake223 It work,but I don't understand why have to delete the alias of awk?Is it awk can't use alias? – choujayyl – 2013-01-21T03:50:56.847

awk is a program you want to run, but when you type awk at the prompt, it looks first for aliases and then at programs that could be executed. So if there is an alias in place, it will prevent you from running the program. – Jakob Weisblat – 2013-01-21T04:04:56.163

@Jake223 I changed the path of awk that alias,like awk='awk -f /usr/bin/awk',but I input the same command ,it doesn't work.. It shows me that "awk: 1:unexpected character 0x7f , awk /usr/bin/awk: line 1: runway regular expression /xx" Why input same command your method can make it work,but my method that doesn't work ? – choujayyl – 2013-01-21T08:38:53.047

you want awk to be awk or /usr/bun/awk, not awk -f something else. – Jakob Weisblat – 2013-01-21T15:07:56.953