简体   繁体   中英

passing the same file path to command after first command is done executing in an alias

I am dumping make test output to a text file

make test > & ~/Desktop/makeTestOutput.txt

now I want to make an alias in a way that once the make test dumping is done the path ~/Desktop/makeTestOutput.txt should be used by next command I made fetest interpret and present readable data in Terminal.

I was thinking to do this make test > & $1 | fetest $1 make test > & $1 | fetest $1 but that doesnt pipe the file path to fetest .

Aliases handle arguments automatically and it is not possible to do what you want with simply using aliases. You should use functions instead. Check here for more details: https://unix.stackexchange.com/questions/3773/how-to-pass-parameters-to-an-alias

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