user3742475
user3742475

Reputation: 5

Why can't I execute this script?

I'm trying to execute a string (actually it's a part of a longer string that I split into different strings.

my error message is tr1.sh: 3: tr1.sh: Bad substitution

#!/bin/bash

if [ ! -d ${HOME }/ trashbin  ]
then  mkdir ${HOME }/ trashbin
fi

Upvotes: 0

Views: 68

Answers (1)

user1046334
user1046334

Reputation:

Remove the spaces:

#!/bin/bash

if [ ! -d ${HOME}/trashbin  ]
then  mkdir ${HOME}/trashbin
fi

Upvotes: 4

Related Questions