`echo prefix =〜/.node>>是什么意思? 〜/.npmrc`是什么意思? [英] What does `echo prefix = ~/.node >> ~/.npmrc` mean?

查看:158
本文介绍了`echo prefix =〜/.node>>是什么意思? 〜/.npmrc`是什么意思?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在阅读 stackoverflow答案,它们是在运行yonpm而没有sudo时运行的,方法是保存它们结果为~/.node.

I'm reading this stackoverflow answer on running yo and npm without sudo by saving their results in ~/.node.

它使用echo prefix = ~/.node >> ~/.npmrc,在这种情况下,我想知道每个符号的含义以及它们如何协同工作.

It uses echo prefix = ~/.node >> ~/.npmrc, and I'd like to know what each symbol means and how they work together in this case.

推荐答案

echo prefix = ~/.node

这只是将字符串打印到标准输出.外壳程序会将~扩展为$HOME的值,因此打印的字符串可能类似于"prefix = /home/randwa1k"(当然不带引号).

This simply prints a string to standard output. The shell will expand ~ to the value of $HOME, so the string printed might be something like "prefix = /home/randwa1k" (without the quotation marks, of course).

... >> ~/.npmrc

这会将echo命令的输出重定向到文件~/.npmrc,该文件扩展为与$HOME/.npmrc相同的内容.使用>>而不是>意味着输出将附加到文件末尾.

This redirects the output of the echo command to the file ~/.npmrc, which expands to the same thing as $HOME/.npmrc. Using >> rather than > means that the output is appended to the end of the file.

因此,该命令总体上将一行文本附加到主目录中名为.npmrc的文件中.

So the command as a whole appends one line of text to a file called .npmrc in your home directory.

.npmrc文件所做的更改将取决于读取该文件的程序.

The effects of that change to the .npmrc file are going to depend on whatever programs read that file.

这篇关于`echo prefix =〜/.node>>是什么意思? 〜/.npmrc`是什么意思?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆