Sunday, May 2, 2021

How to define a temporary variable in mac Terminal

How to define a temporary variable in mac Terminal?
 

Example1: Lets say I want to store company Name into a temporary variable in a terminal and display it.

export companyName="GGHL"
echo $companyName
GGHL

 

Example2: Display machine name path

export myhomedir=/Userss/${USER}
echo $myhomedir
/Users/username

No comments:

Post a Comment

Please add value. Sharing is caring