Change: xecho: execute permission denied error


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Change: xecho: execute permission denied error
# 1  
Old 12-04-2009
Change: xecho: execute permission denied error

Hello,

I am have an issues with one of my scripts. I get the following error when I get to the point in the script where I am making the change. The change does take however. the error is "change: xecho: execute permission denied"

Everything was working properly until I start cleaning up the code. (indent) Smilie

Code:
ans=y
while [ "$ans" = "y" ]
do

	cat<<here0

${bold}Please enter the name of the user you want to change:${off}

here0

	read name

	clear

	grep -in "$name" phonebook | sed -n -e 's/^/\
				/' -e 's/:/\
				/gp'

	cat<<here1
	
${blink}${bold}Please enter the record that you want to change:${off}    

here1

	read number

record=`sed -n ${number}p phonebook`

name=`echo "$record"| cut -d: -f1`
address=`echo "$record"|cut -d: -f2`
city=`echo "$record"|cut -d: -f3`
state=`echo "$record"|cut -d: -f4`
zip=`echo "$record"|cut -d: -f5`
phone=`echo "$record"|cut -d: -f6`

	echo "Do you want to change $name's name? (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     			echo "Please enter new name"
     			read newname
     			name=$newname

	fi

	xecho "Do you want to change $address?  (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     			echo "Please enter new address"
     			read newaddress
     			address=$newaddress

	fi

	echo "Do you want to change $city?  (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     			echo "Please enter new city"
     			read newcity
     			city=$newcity

	fi

	echo "Do you want to change $state?  (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     			echo "Please enter new state"
     			read newstate
     			state=$newstate

	fi

	echo "Do you want to change $zip?  (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     			echo "Please enter new zip"
     			read newzip
     			zip=$newzip

	fi

	echo "Do you want to change $phone?  (y/n) \c"
	read ans
	if [ "$ans" = "y" ]
		then 
     		echo "Please enter new phone number"
     		read newphone
     		phone=$newphone
	

	fi

	sed "$number"d phonebook > phonebook.tmp
	mv phonebook.tmp phonebook
	echo "$name:$state:$city:$state:$zip:$phone" >> phonebook
	echo "Would you like to change another record? /c"
	read ans

done



---------- Post updated at 04:04 PM ---------- Previous update was at 03:14 PM ----------

Never mind I found the issue. It was a typo.

One other issue that I am having is when a user is not found in the file it hangs until the user presses return. How can I do some type of validation?

Thanks
# 2  
Old 12-04-2009
Hi.

Welcome to the forums.

Meta-answers:

Psychology 101: Post the shortest possible example of the problem. You posted 100+ lines. I would not slog through that to find an error. You didn't seem to put in much time to seek the answer with experimentation, so why should I spend my time? There are situations when you may need to post an entire script, but I have found that to be a rare occasion.

Psychology 102: Ask one question per thread. You added that you solved the problem, then more than 100 lines down, you bury your second question. Most people will have quit reading before or by that point.

Think how you would like questions asked of you, probably: short, and one main question per thread.

Best wishes ... cheers, drl
# 3  
Old 12-04-2009
Thanks for the advise. After I spotted the typo I wanted to remove the post. Is that possible? Thanks
# 4  
Old 12-04-2009
Hi.

I don't recall for sure. On some forums when you edit a post, you are given the option to delete. However, if there has been a reply, then probably not because that would destroy the continuity and context.

I would not worry about this one in any case, just post your new question in a new thread. You can certainly refer to this thread from your new thread by copying this URL if necessary.

Good luck ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. HP-UX

Swinstall and rsync - execute permission denied

Hello, I have managed to install rsync using swinstall and also as far as I can tell the dependancies we didn't have. However when trying to execute the binary I get the following error :- />rsync sh: rsync: Execute permission denied. />which rsync /usr/local/bin/rsync... (10 Replies)
Discussion started by: YogaBija
10 Replies

2. UNIX for Dummies Questions & Answers

Webserver permission denied error

Hello, I was trying a perl-cgi tutorial and saving the data from online form to a file named (guests.txt). I am using the localhost port 80 for practice. My page file "guestbook.html" is working as I saw the online form. After filled out the blanks and submit, I was expecting to see the result... (3 Replies)
Discussion started by: yifangt
3 Replies

3. UNIX for Dummies Questions & Answers

Getting Error 0403-006 Execute permission denied.

Hi All, Need your help.. I am writing one script in which I am assigning value to one variable but when i am executing it is showing error "0403-006 Execute permission denied" below is the line of that script : INPUT_COUNT=wc $GIF_DIR/input/VID_RIMS.DAT | awk '{print $1}' and access... (2 Replies)
Discussion started by: NirajThakar
2 Replies

4. OS X (Apple)

Permission Denied Error with X11

Hello, I am using Tiger 10.4.11 I am trying out the GIMP, so I installed the X11 package from "Optional Installs" on the cd. Whenever I open X11, I get an error: xterm: could not exec /dev/null: Permission denied I have chmodded /dev/null to 777, as well as the /tmp directory. I deleted... (2 Replies)
Discussion started by: Ricardo-san
2 Replies

5. AIX

rm: execute permission denied in AIX

Hello All, We have an existing ssh set-up between 2 Unix servers ( Server A and Server B). Recently, we've had a problem where we cannot delete files (via app engine and even manually, after connecting thru ssh) on Server B. We manage Server A but Server B is handled by a different group, as a... (1 Reply)
Discussion started by: chipahoys
1 Replies

6. AIX

0403-006 Execute permission denied.

Hi i am running the below script in vio server, i changed to aix mode..then #./script1 </code> ##Set today Date as file name. vardate= date +"%m%d%y%H%M%S" varhost= hostname filename= "$varhost_$vardate" echo $filename </code> the output is ....... </code> # ./mount_test ... (6 Replies)
Discussion started by: honeym210
6 Replies

7. UNIX for Advanced & Expert Users

wat is execute permission denied???

hi, i have a problem and is needed by next week. when i need to run a program at the specified time using the crontab, after that the program which will send a messege to the screen using the say command, which will show "Hello" but there is an error when i run it, in the mail it show that ... (5 Replies)
Discussion started by: ckng
5 Replies

8. Shell Programming and Scripting

xterm gives me permission denied error

When I try to run xterm at a command prompt in solaris 2.5.1, i'm getting a permission denied error. But the directory and user permissions look ok, they are part of a users group and then also root,sys,adm so what gives? Any ideas? Thanks! (1 Reply)
Discussion started by: kymberm
1 Replies

9. UNIX for Advanced & Expert Users

getcwd: permission denied error

When I do a 'cd /appl' and issue 'ls -al' command, I get the following error for .. directory. ./..: Permission denied But still I get a listing of other directories under /appl. Also, if I give 'man' for any command under this /appl folder, I get the following error: ... (3 Replies)
Discussion started by: Deepa
3 Replies

10. UNIX for Dummies Questions & Answers

rm Permission Denied error

I am very new to Unix. We have a script that will remove files from a directory. The account removing the files has the same permissions as the directory the files are located. We have logged in as the account and deleted the files from that directory but when we run the script with the account... (7 Replies)
Discussion started by: Cech2002
7 Replies
Login or Register to Ask a Question