pmcmicha
Technical User
- May 25, 2000
- 353
I am writing a script in ksh and I am attempting to do the following, which should be possible.....
#!/bin/ksh -p
if [[ -d /home/someone ]]
then
1=$(echo "Found"
else
1=$(echo "Invalid"
fi
if [[ -f /test/test1 ]]
then
2=$(echo "Found"
else
2=$(echo "Invalid"
fi
echo "Now checking for someones directory\t\c" ${1}
echo
echo "Now checking for test file\t\c" ${2}
The problem is that the shell keeps giving me errors stating that 1=Found is not found. Same with 2. I know I could just write the echo statements and then do the test conditions, but I would like to seperate them this time to see how this looks. Is this possible? Thanks.
#!/bin/ksh -p
if [[ -d /home/someone ]]
then
1=$(echo "Found"
else
1=$(echo "Invalid"
fi
if [[ -f /test/test1 ]]
then
2=$(echo "Found"
else
2=$(echo "Invalid"
fi
echo "Now checking for someones directory\t\c" ${1}
echo
echo "Now checking for test file\t\c" ${2}
The problem is that the shell keeps giving me errors stating that 1=Found is not found. Same with 2. I know I could just write the echo statements and then do the test conditions, but I would like to seperate them this time to see how this looks. Is this possible? Thanks.