?
Solved

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

Posted on 2003-02-20
3
Medium Priority
?
216 Views
Last Modified: 2013-12-27
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
Comment
Question by:Raj07
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 5

Accepted Solution

by:
Nisus091197 earned 200 total points
ID: 7989389
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
 
LVL 18

Expert Comment

by:liddler
ID: 10425871
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: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Let's say you need to move the data of a file system from one partition to another. This generally involves dismounting the file system, backing it up to tapes, and restoring it to a new partition. You may also copy the file system from one place to…
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.
Suggested Courses

765 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question