Add a space after [
and before ]
.
[ -d $1 ]
^ ^
More Related Contents:
- create a file with prefix =file1 followed by the random number
- Why to code a script which will check if some package is installed in linux and if not then install it?
- Pseudo-terminal will not be allocated because stdin is not a terminal
- Aborting a shell script if any command returns a non-zero value
- Is there a “goto” statement in bash?
- Shell script: Run function from script over ssh
- How can I quickly sum all numbers in a file?
- Bash script process substitution Syntax error: “(” unexpected
- What is the difference between using `sh` and `source`?
- Setting environment variables in Linux using Bash
- How can I loop over the output of a shell command?
- Why does /bin/sh behave differently to /bin/bash even if one points to the other?
- [ :Unexpected operator in shell programming [duplicate]
- Does “argument list too long” restriction apply to shell builtins?
- Given two directory trees, how can I find out which files differ by content? [closed]
- Run a shell command when a file is added
- Using the passwd command from within a shell script
- Add a bash script to path
- Get last dirname/filename in a file path argument in Bash
- Bash script execution with and without shebang in Linux and BSD
- bash command not found when setting a variable
- How do you normalize a file path in Bash?
- Exit code of variable assignment to command substitution in Bash
- Linux/Unix command to determine if process is running?
- How do I remove newlines from a text file?
- How to copy a file to multiple directories using the gnu cp command
- What is the Linux equivalent to DOS pause?
- How to check if sed has changed a file
- Counter increment in Bash loop not working
- How to pass parameters to a Bash script?