Re: Shell files won't execute properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 03/30/2010 10:12 AM, Robert Nichols wrote:
On 03/29/2010 06:54 PM, Jim wrote:
On 03/29/2010 06:54 PM, Craig White wrote:
On Mon, 2010-03-29 at 18:45 -0400, Jim wrote:

On 03/29/2010 06:20 PM, Robert Nichols wrote:

On 03/29/2010 02:25 PM, Jim wrote:


On 03/29/2010 02:52 PM, Michael.Coll-Barth@xxxxxxxxxxxxxxxxxxx wrote:



[SNIP]
FC12-KDE-4

Shell files (/bin/bash) won't execute when Left clicking on
them, single
or double click.

They won't even execute if I tell them "Open With" Konsole,
Konsole will
open , but file won't execute.

If I do a bash "filename" then it will execute in konsole.



What User/Group are you running these scripts as and what are the
permissions on the files?
[SNIP]
The user/user owns the file, same user, and the file permissions is set
to rwxrwxr-x


Are you certain the file system is not mounted "noexec"?



How would I check that out ?

----
open a shell, type 'mount'

Craig



$ mount
/dev/sda1 on / type ext4 (rw)
proc on /proc type proc (rw)
sysfs on /sys type sysfs (rw)
devpts on /dev/pts type devpts (rw,gid=5,mode=620)
tmpfs on /dev/shm type tmpfs (rw,rootcontext="system_u:object_r:tmpfs_t:s0")
/dev/sda2 on /home type ext4 (rw)
none on /proc/sys/fs/binfmt_misc type binfmt_misc (rw)
sunrpc on /var/lib/nfs/rpc_pipefs type rpc_pipefs (rw)
nfsd on /proc/fs/nfsd type nfsd (rw)
gvfs-fuse-daemon on /home/mickey/.gvfs type fuse.gvfs-fuse-daemon
(rw,nosuid,nodev,user=mickey)
OK.  Another possibility is that the file is in DOS format with a carriage
return (^M) at the end of each line.  That carriage return character on the
first line "#!/bin/sh^M" will make the kernel look for a nonexistent shell.
A lot of "smart" editors will hide that character and helpfully reproduce
that format on each line when you write the file, so you either need a
keen eye on the status line or a tool like 'od' to see that '^M'.  You
can try running 'dos2unix' on the file and see if that fixes the problem
(file size will change).


#!/bin/bash

function internet_connection_ok
	{
		clear
		echo "Testing internet connection....please wait..."
		if ping -W 1 -c 4 bix.hu | grep -q "4 received"; then 
			if ping -W 1 -c 4 www.yahoo.com | grep -q "4 received"; then echo "NET is OK"; else echo "NO INTERNET CONNECTION"; exit 1; fi
		else clear; echo "NO INTERNET CONNECTION"; exit 1; fi 
	}

internet_connection_ok

-- 
users mailing list
users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe or change subscription options:
https://admin.fedoraproject.org/mailman/listinfo/users
Guidelines: http://fedoraproject.org/wiki/Mailing_list_guidelines
[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [Fedora Magazine]     [Fedora News]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Maintainers]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Legacy]     [Fedora Desktop]     [Fedora Fonts]     [ATA RAID]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [SSH]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Centos]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Tux]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Asterisk PBX]     [Fedora Sparc]     [Fedora Universal Network Connector]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux