![]() |
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here. |
More UNIX and Linux Forum Topics You Might Find Helpful
|
||||
| Thread | Thread Starter | Forum | Replies | Last Post |
| error running sqlplus from shell file | mmunir | Shell Programming and Scripting | 3 | 02-06-2009 04:52 AM |
| error in in running script | aama100 | Shell Programming and Scripting | 2 | 10-20-2008 01:52 AM |
| Running from Shell Vs running from RC script | vickylife | SUN Solaris | 2 | 07-31-2008 10:01 AM |
| error in running shell script in cron | sari | Shell Programming and Scripting | 3 | 04-16-2008 05:09 AM |
| Error while running a script | HarryTellegen | UNIX for Dummies Questions & Answers | 5 | 02-05-2002 02:58 AM |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
||||
|
Error while running as shell script
Code:
Storage_Unit=`du -h /var/spool/cron/root|awk '{print $1}'|sed -e "s/^.*\(.\)$/\1/"`
If [ $Storage_Unit = "G" ]
then
Size=`du -h /var/spool/cron/root|awk '{print $1}'|sed 's/.\{1\}$//'`
for Size_rounded_number in $(printf %.0f $Size); do
ROUNDED_Size=$Size_rounded_number
done
if [ $ROUNDED_Size -gt "10" ] #setting a threshold of say 10G
cp /dev/null /var/spool/mail/root
else
echo "Size in $ROUNDED_Size
fi
else
echo "storage unit in $Storage_Unit"
fi
I am getting the following error while running the script: Code:
test1.sh: line 2: If: command not found test1.sh: line 3: syntax error near unexpected token `then' test1.sh: line 3: `then' ---------- Post updated at 05:12 PM ---------- Previous update was at 05:05 PM ---------- Worked it out. Their was a typo error: Code:
If instead of if Now getting another error: Code:
test1.sh: line 3: syntax error at line 12: `else' unexpected |
| Bookmarks |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|