You need to use =
instead of ==
in the [ $? == 0 ]
line.
More Related Contents:
- How to loop through file names returned by find?
- Fast way of finding lines in one file that are not in another?
- How to use ‘find’ to search for files created on a specific date? [closed]
- How can I exclude all “permission denied” messages from “find”?
- Recursively rename files using find and sed
- Error when using ‘sed’ with ‘find’ command on OS X: “invalid command code .”
- How to recursively find the latest modified file in a directory?
- Delete files older than 10 days using shell script in Unix [duplicate]
- Find and replace filename recursively in a directory
- find: missing argument to -exec
- find files older than X days in bash and delete
- How can I get a recursive full-path listing, one line per file?
- How to go to each directory and execute a command?
- find -exec with multiple commands
- What is the best way to count “find” results?
- Looping through find output in Bash where file name contains white spaces
- Use GNU find to show only the leaf directories
- An efficient way to transpose a file in Bash
- How to use aliases defined in .bashrc in other scripts?
- source command not found in sh shell
- Cron jobs and random times, within given hours
- Single script to run in both Windows batch and Linux Bash?
- Detect if PATH has a specific directory entry in it
- How to view files in binary from bash?
- Bash: Parse CSV with quotes, commas and newlines
- Unable to forward search Bash history similarly as with CTRL-r
- Looping over arrays, printing both index and value
- Temporarily change current working directory in bash to run a command [duplicate]
- How to assign a glob expression to a variable in a Bash script?
- What’s the difference between “here string” and echo + pipe