Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.user > #268573

Re: variables in bash

From Paul M Foster <paulf@quillandmouse.com>
Newsgroups linux.debian.user
Subject Re: variables in bash
Date 2024-03-28 12:30 +0100
Message-ID <ImW7g-2fFJ-3@gated-at.bofh.it> (permalink)
References <ImUoN-2eiy-9@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, Mar 28, 2024 at 10:37:25AM +0100, Hans wrote:

> Hi folks,
> 
> just an easy question:
> 
> What is the difference (if any) between the following two variables in a 
> shellfile in bash:
> 
> 1. mypath=/home/user1/Tools/

Here you are assigning a value to the variable "mypath". You can surround
"/home/user1/Tools" with quotes if you like, but it is not strictly
necessary.

> 
> and $mypath

Here you are actually *using* the variable "mypath".

Here is another example:

NAME="paulf"
echo "My name is $NAME."

which will yield:

My name is paulf.


-- 
Paul M. Foster
Personal Blog: http://noferblatz.com
Company Site: http://quillandmouse.com
Software Projects: https://gitlab.com/paulmfoster

Back to linux.debian.user | Previous | Next — Previous in thread | Find similar | Unroll thread


Thread

variables in bash Hans <hans.ullrich@loop.de> - 2024-03-28 10:40 +0100
  Re: variables in bash Greg Wooledge <greg@wooledge.org> - 2024-03-28 12:20 +0100
    [SOLVED] Re: variables in bash Hans <hans.ullrich@loop.de> - 2024-03-28 14:10 +0100
  Re: variables in bash Paul M Foster <paulf@quillandmouse.com> - 2024-03-28 12:30 +0100

csiph-web