• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 217
  • Last Modified:

Getting syntax error on line 33 of the following script .Help??

Iam a novice in Unix /solaris .Trying to run this script on a solaris 8.0 intel box. I have tried omitting -e option to echo as well as the \c option .Both giving sysntax error.
Can anybody help what is to be done?? Is it differant  when we try this in solaris?

script is :

1 # Todo: A task list manager which is for personal use which is interactive
2 #
3 #!/bin/sh
4
5 if [ !  -f $Home/items ]
6
7 then
8 echo "creating the items file"
9
10 touch $HOME/items
11
12 fi
13 datafile=$HOME/items
14
15 while:
16 do
17 echo "TODO MANAGER
18 ---------------------
19 change [F]ile
20 [A]dd Item
21 sort Items by [D]ate
22 sort items by [P]riority
23 [E]dit the list
24 [L]ist sorted items
25 E[X]it
26 enter selection:"
27 read response
28 case $response in
29 f|F) echo "File functions here" ;;
30 a|A) echo "Add functions here" ;;
31  # Ask the user about the item##
32  #
33  echo -e "Enter Task priority: [5] \c"
34  read priority
35 echo -e "Enter status [p d i]: [p] \c"
36 read tstat
37 echo -e "Enter due date [YYYYDDMM]: [20030101] \c"
38 read duedate
39 echo -e "Enter Task:"
40 read tasktodo
41##############################################
42#   Now write the data to the end of file
43################################################
44 echo ${priority:=5} ${tstat:=p} ${duedate:=20030101} $tasktodo >> $datafile ;;
45
46 d|D) echo "sort by date" ;;
47 p|P) echo "sort by priority" ;;
48 e|E) echo "Edit the list" ;;
49 l|L) echo "listing the TODO list as of `date`" ;;
50 x|X) echo "Bye"
51 Exit 0 ;;
52 *)
53    echo " Please enter a selection shown in []" ;;
54 esac
40     done
0
Raj07
Asked:
Raj07
1 Solution
 
Nisus091197Commented:
Hi,

This is a common problem.  The trouble arises as the shells have their own built-in echo command:

If you are running the Bourne shell (/bin/sh) then either of these should work:

echo "Enter Task priority: [5] \c"
/usr/bin/echo "Enter Task priority: [5] \c"

Have a look at the online man pages to learn more:

man echo
man shell_builtins

Regards, Nisus
http://www.omnimodo.com
0
 
liddlerCommented:
No comment has been added lately, so it's time to clean up this TA.
I will leave a recommendation in the Cleanup topic area that this question is:

Answered by Nisus

Please leave any comments here within the next four days.

PLEASE DO NOT ACCEPT THIS COMMENT AS AN ANSWER!

liddler
EE Cleanup Volunteer
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Tackle projects and never again get stuck behind a technical roadblock.
Join Now