• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

shell script question with cat

tony4704

Senior member
Hey all I created a simple shell script, im a noob to shell scripting, but I am trying to figure out what im doing wrong.

here is the script:

#!/bin/sh
if [ 'cat file' -eq "" ]
then
echo "installation not found"
else
cat file
fi


What im trying to accomplish is if cat can open the file then show the contents of it, if it cant then display a message. What am I doing wrong here? Thanks.
 
As a side note, make sure the quotes around 'cat file' are backticks (i.e. `:the character under ~) instead of single quotes which you've posted above.
 
Back
Top