Search Results

Search: Posts Made By: saggy9583
22,117
Posted By saggy9583
For me - only for ! or negative condition I...
For me - only for ! or negative condition I should have to put space after IF,"[" and "]" but for normal or posivitive condtion only one space after if working. Anyway it good practice to put space...
22,117
Posted By saggy9583
OMG ...It really funny now it's working just...
OMG ...It really funny now it's working just putting space after IF ... welcome to shell scripting .. :)

if [-d /var/log/messages]
then
echo "This dir not exists."
fi

Thanks much...
22,117
Posted By saggy9583
Yes I tried to use the space if[[ -f...
Yes I tried to use the space

if[[ -f /var/log/messages ]]
then
echo "This dir not exists."
fi

Error :
if[[ -f /var/log/messages ]]: not found
syntax error: `then' unexpected
...
22,117
Posted By saggy9583
Still it's not working after using space. Its...
Still it's not working after using space.
Its giving error as
if[ -f /var/log/messages ]: not found #==> I did put one space at start and end of [ ]
syntax error: `then' unexpected
22,117
Posted By saggy9583
If statement is not working in KSH
#! /bin/ksh

rm -f ./xyz file --- this line is working

// Below any if stmt is not working.
if[-f /var/log/messages ]
then
echo " blah blah "
fi

or I replaced above if with
if[-d...
Showing results 1 to 5 of 5

 
All times are GMT -4. The time now is 03:56 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy