Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Bad substitution in Parameter Expansion



On Feb 23,  6:02pm, Darryl Zurn wrote:
} Subject: Bad substitution in Parameter Expansion
}
} (16:51:%)  dt () {
} (function)    if [[ -z $1 ]]
} (function if)         then
} (function then)               print Need arguments
} (function then)       else
} (function else)               mytext=$1
} (function else)               convertcolons=${$mytext//:/\/}
} (function else)               convertspaces=${$convertcolons// /\\ } 

Look more closely:  you have extra "$" on the above two lines.

} (function else)               basename=${$convertspaces:h} 
} (function else)               cd '/Volumes/'$basename
} (function else)       fi
} (function)   }

I've pointed out the reason for the error message, but I don't vouch for
the correctness of the function otherwise (see Mikael's mail).



Messages sorted by: Reverse Date, Date, Thread, Author