简体   繁体   中英

Why can't I run ack from the terminal after I switched from ubuntu to archlinux?

I just switch from ubuntu to archlinux and I installed ack-grep via pacman. However what I found is I can't run $ ack from terminal directy. I have to type $ perl ack , which is a pain...I wonder if anyone hve experienced similar situation and how do you solve it.

Thanks

There is no reason to use an alias here. It is perl's job to update $PATH in this case. Seeing that the perl package is included in the base group then at most re-logging in should correct everything.

I've also tested this on my system and pacman -Syu ack (-Syu should always be used when installing).

# pacman -Syu ack

# ack --help (no error)

Also

$ which ack

/usr/bin/vendor_perl/ack

It depends on the shell you're using. Probably the simplest thing you can do (assuming bash ) is to create an alias for your desired command, something like:

alias acx='perl ack'

You'll probably want to place that somewhere in one of your startup scripts, such as .profile , or .bash_profile in your home directory.

If you're using a different sheel that doesn't support aliases, you can still resort to providing a script to do the translation for you, such as putting the following acx file in your path:

perl ack "$@" # or however your particular sheel transfers all arguments.

You should not have to make an alias to run ack as the answer above suggests. Rather than make the workaround alias, let's get your problem fixed.

Why can't you run ack? What happens when you run it? Did you get an error message? What was the error message?

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM