0

Here is my shell script

#!/bin/bash

d="${HOME}/image-dir"
# Expanding to /Users/napoleon/image-dir

d1="~/image-dir"
# Expands to ~/image-dir

also in the command line 
echo "~" # output is ~
echo  ~  # output is "/Users/napoleon"

could someone explain the reason behind this? Is it working as per manual

The intent of this question is to know why tilde is not working inside double quotes "~".

indianwebdevil
  • 4,551
  • 7
  • 34
  • 47

0 Answers0