Sponsored Content
Top Forums Shell Programming and Scripting Change: xecho: execute permission denied error Post 302377655 by simpsonjr on Friday 4th of December 2009 04:04:26 PM
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
 

10 More Discussions You Might Find Interesting

1. 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

2. 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

3. 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

4. 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

5. 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

6. 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

7. 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

8. 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

9. 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

10. 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
CHECKBASHISMS(1)					      General Commands Manual						  CHECKBASHISMS(1)

NAME
checkbashisms - check for bashisms in /bin/sh scripts SYNOPSIS
checkbashisms script ... checkbashisms --help|--version DESCRIPTION
checkbashisms, based on one of the checks from the lintian system, performs basic checks on /bin/sh shell scripts for the possible presence of bashisms. It takes the names of the shell scripts on the command line, and outputs warnings if possible bashisms are detected. Note that the definition of a bashism in this context roughly equates to "a shell feature that is not required to be supported by POSIX"; this means that some issues flagged may be permitted under optional sections of POSIX, such as XSI or User Portability. In cases where POSIX and Debian Policy disagree, checkbashisms by default allows extensions permitted by Policy but may also provide options for stricter checking. OPTIONS
--help, -h Show a summary of options. --newline, -n Check for "echo -n" usage (non POSIX but required by Debian Policy 10.4.) --posix, -p Check for issues which are non POSIX but required to be supported by Debian Policy 10.4 (implies -n). --force, -f Force each script to be checked, even if it would normally not be (for instance, it has a bash or non POSIX shell shebang or appears to be a shell wrapper). --extra, -x Highlight lines which, whilst they do not contain bashisms, may be useful in determining whether a particular issue is a false posi- tive which may be ignored. For example, the use of "$BASH_ENV" may be preceded by checking whether "$BASH" is set. --version, -v Show version and copyright information. EXIT VALUES
The exit value will be 0 if no possible bashisms or other problems were detected. Otherwise it will be the sum of the following error val- ues: 1 A possible bashism was detected. 2 A file was skipped for some reason, for example, because it was unreadable or not found. The warning message will give details. SEE ALSO
lintian(1). AUTHOR
checkbashisms was originally written as a shell script by Yann Dirson <dirson@debian.org> and rewritten in Perl with many more features by Julian Gilbey <jdg@debian.org>. DEBIAN
Debian Utilities CHECKBASHISMS(1)
All times are GMT -4. The time now is 02:31 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy