Skip to content
Advertisement

A confusion about the alias area of bashrc file

I want write my own alias called oepnserver. The functions of the oepnserver are:

  • show my ip address
  • use python module to start a server on current folder.

The detailed code is listed below:

JavaScript

When I type oepnserver, my terminal only shows:

JavaScript

However, my expectation was

JavaScript

I also try to use the ifconfig wlan0 |grep inet |awk '{print $2}' along, and I get the correct output.

Should I use another way to combine these two commands instead of &&? Or I just made some typo?

Advertisement

Answer

Based on your shown code I am trying to optimize it which could be done by single awk.

JavaScript

Also IMHO you should try to make this as a function rather than alias.

Advertisement