用Java加载类(Loading of a class in Java)
在java中编译源代码时,会加载类。 加载一个类意味着什么?
对一些学习材料的详细解释或链接将非常有帮助。
In java when we compile a source code, the classes are loaded. What does loading of a class mean ?
An elaborate explanation or link to some study material will be very helpful.
原文:https://stackoverflow.com/questions/4401002
最满意答案
一个别名不能接受参数,所以你需要创建一个函数:
acp () { git add -A;git commit -m "$1";git push }
一如既往,将其存储在
~/.bashrc
,并使用source ~/.bashrc
。或者更好的( 好提示,binfalse )避免执行一个命令,如果以前不成功,在它们之间加上
&&
:acp () { git add -A && git commit -m "$1" && git push }
执行它
acp "your comment"
使用双引号是很重要的,否则它只会得到第一个参数。
An alias cannot accept parameters, so you need to create a function:
acp () { git add -A;git commit -m "$1";git push }
as always, store it in
~/.bashrc
and source it withsource ~/.bashrc
.Or better (good hint, binfalse) to avoid performing a command if the previous was not successful, add
&&
in between them:acp () { git add -A && git commit -m "$1" && git push }
Execute it with
acp "your comment"
It is important that you use double quotes, otherwise it will just get the 1st parameter.
相关问答
更多-
脚本中的全局bash别名(Global bash alias from script)[2021-12-31]
正确的方法是获取脚本,而不是运行脚本。 source myscript.sh mycmd The proper way to do is to source the script rather than running it. source myscript.sh mycmd -
Bash别名查询(Bash alias query)[2022-06-07]
如何使用函数? 将其添加到.bashrc: function searchFiles() { find . -name \*."$1" -print0 | xargs -0 grep --color -n "$2" } 然后像这样使用它: $ searchFiles c include How about using a function? Add this to your .bashrc: function searchFiles() { find . -name \*."$ ... -
根据以下环境变量名称只能包含 大写字母,数字和便携式字符集中定义的字符的'_'(下划线),并且不以数字开头。 其他角色可能会被执行所允许; 应用程序应该容忍这些名称的存在。 但变量与别名不同。 在实践中, - (短划线)应该被添加到列表中,因为它是debian( apt-get )中的事实标准。 另外_~!@#$%^.,[]+/? 所有的工作和><'"|=()backtick 。不要。另外你必须担心$PATH和像下面这样的字符: 。看起来空间和换行符可以工作,如果它们被正确地转义或引用像"ab" 。 Acc ...
-
我不认为你可以这样使用别名。 但是,您可以声明一个函数: function t { cd "$1" ls -la } I don't think you can use aliases that way. You can, however, declare a function: function t { cd "$1" ls -la }
-
在bash中创建别名(creating alias in bash)[2024-03-17]
创建别名: alias e=execute 作为一个例子,我有别名的l 。 我仍然可以输入l -l ,它按预期工作。 任何args都会通过。 Make your alias: alias e=execute As an example, I have ls aliased to l. I can still type l -l and it works as expected. Any args just get passed through. -
用户输入到Bash别名?(User Input to Bash Alias?)[2023-05-27]
一个别名不能接受参数,所以你需要创建一个函数: acp () { git add -A;git commit -m "$1";git push } 一如既往,将其存储在~/.bashrc ,并使用source ~/.bashrc 。 或者更好的( 好提示,binfalse )避免执行一个命令,如果以前不成功,在它们之间加上&& : acp () { git add -A && git commit -m "$1" && git push } 执行它 acp "your c ... -
尝试这个: #!/bin/bash permalias() { local alias_regex='[A-Za-z_0-9]*' if [[ $# = 1 && $1 =~ ($alias_regex)=(.*) ]] then printf "%s\n" "${BASH_REMATCH[1]}=\"${BASH_REMATCH[2]}\"" >> ~/.bashrc else echo "USAGE: permalias VARNAME=ALIAS_COMMAND ...
-
bash别名无法创建(bash alias not able to create)[2020-01-27]
您需要在等号后删除空格。 You need to remove the space after the equal sign. -
Bash别名使用!$(Bash alias using !$)[2023-08-14]
您可能还想使用Bash的$_内部变量 ,而不是摆弄Bash的历史:手册的相关部分说明: $_ :[...]扩展后扩展到上一个命令的最后一个参数。 [...] 例如: $ touch one two three $ echo "$_" three $ ls $ echo "$_" ls $ a='hello world' $ echo $a hello world $ echo "$_" world $ echo "$a" hello world $ echo "$_" hello world $ 在您的 ... -
当您可以轻松地使用函数执行它时,定义alias不是正确的方法,并使用bash ,算术运算符$(()) function mins_ago() { printf "%s" "$(( $(date +%s) - (60 * $1) ))" } 在.bash_profile添加上面的函数,现在在命令行中测试它, date +%s 1485414114 value="$(mins_ago 3)" printf "%s\n" "$value" 1485413834 (或)没有临时变量在GNU date转 ...