This question already has answers here:
What is the benefit of using $() instead of backticks in shell scripts?
                                
                                    (8个答案)
                                
                        
                        
                            YYYY-MM-DD format date in shell script
                                
                                    (13个回答)
                                
                        
                                去年关闭。
            
                    
我正在学习bash脚本,正在阅读一些示例代码。
任何人都可以建议我以下代码的详细信息和含义吗?提前致谢!

END_DATE=`date -u "+%FT%TZ" `

最佳答案

反引号正在执行Command Sbustitution。反引号内的命令在子shell中执行,并将结果分配给变量。 (另一种在bash中起作用的语法是$(command)

date命令的字符串是为date command指定格式的方式。

关于linux - 有关反引号和%string的含义的问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/54084542/

10-11 17:45