Author Topic: File Found But Not ?  (Read 2928 times)

tesla_cubed

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://
File Found But Not ?
« on: March 13, 2007, 05:29:51 pm »
I put together a fiew scripts to start and stop stuff depending on what I want to do. nothing fancy just saving some typing. Work start WPA, start dhcp, start samba, kinda stuff. Here is whrer things get wierd .  ls shows my script ls -l shows its executable and ownd by root  
Code: [Select]
-rwxrwxrwx    1 root     root           92 2007-03-13 15:10 work
-rwxrwxr-x    1 root     root           77 2006-09-22 17:53 wpa

When I try to run it i get
Code: [Select]
root-:) work
-bash: work: command not found
This also happens if I copy a binary exe from anywhere except in the Z. Things installed with ipkg and things that are made with make work. It seems to know where there from and if there copied or typed in it dosnt like them. When I first tryed pdaxII1.3 I wrote a small script to load the kennal drivers and start ZKBBD it still works though.  I can edit the scripts but just not run them if I copy a working one and then edit and save as a new name it quits working.

Any sugestions?
thanks
Tesla^3
SL-C3200 (pdaXii)
AmbiCom Wifi
Belkin Palmtop ir keybord

sl-5500 (runing opie whatever.latest.release.is) -touchpanel
1gb SanDisk sd

T3_slider

  • Full Member
  • ***
  • Posts: 125
    • View Profile
File Found But Not ?
« Reply #1 on: March 13, 2007, 06:58:51 pm »
Quote
I put together a fiew scripts to start and stop stuff depending on what I want to do. nothing fancy just saving some typing. Work start WPA, start dhcp, start samba, kinda stuff. Here is whrer things get wierd .  ls shows my script ls -l shows its executable and ownd by root 
Code: [Select]
-rwxrwxrwx    1 root     root           92 2007-03-13 15:10 work
-rwxrwxr-x    1 root     root           77 2006-09-22 17:53 wpa

When I try to run it i get
Code: [Select]
root-:) work
-bash: work: command not found
This also happens if I copy a binary exe from anywhere except in the Z. Things installed with ipkg and things that are made with make work. It seems to know where there from and if there copied or typed in it dosnt like them. When I first tryed pdaxII1.3 I wrote a small script to load the kennal drivers and start ZKBBD it still works though.  I can edit the scripts but just not run them if I copy a working one and then edit and save as a new name it quits working.

Any sugestions?
thanks
Tesla^3
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156147\"][{POST_SNAPBACK}][/a][/div]
Well, the only thing that comes to mind is to go to the directory where your script is located and try
Code: [Select]
./workinstead of simply
Code: [Select]
workOr, alternatively, you could put your script in /usr/local/bin and type "work" from any directory (but make sure your PATH variable is set properly by executing
Code: [Select]
echo $PATHand making sure /usr/local/bin is in your path).

It may not be working because when you execute a command without the ./ it looks in your PATH variable and sees if it is in one of those locations and doesn't execute the command in the present folder.

If I misunderstood the problem, just say so.  
Conics SL-C3200 running pdaXrom beta3 and XFCE with a Planex WiFi CF card.

Slackware rules!

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
File Found But Not ?
« Reply #2 on: March 13, 2007, 07:20:23 pm »
Also make sure you "chmod a+x" the scripts.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

T3_slider

  • Full Member
  • ***
  • Posts: 125
    • View Profile
File Found But Not ?
« Reply #3 on: March 13, 2007, 07:23:12 pm »
Quote
Also make sure you "chmod a+x" the scripts.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156173\"][{POST_SNAPBACK}][/a][/div]
If you look at the ls output of the scripts I don't think this command needs to be executed.
Conics SL-C3200 running pdaXrom beta3 and XFCE with a Planex WiFi CF card.

Slackware rules!

Capn_Fish

  • Hero Member
  • *****
  • Posts: 2342
    • View Profile
    • http://
File Found But Not ?
« Reply #4 on: March 13, 2007, 07:31:06 pm »
I know. Just making sure everybody else know you need to do that.
SL-C750- pdaXrom beta 1 (mostly unused)
Current distro: Gentoo

T3_slider

  • Full Member
  • ***
  • Posts: 125
    • View Profile
File Found But Not ?
« Reply #5 on: March 13, 2007, 09:16:23 pm »
Quote
I know. Just making sure everybody else know you need to do that.
[div align=\"right\"][a href=\"index.php?act=findpost&pid=156179\"][{POST_SNAPBACK}][/a][/div]
I see -- always thinking of others, you are!  
Conics SL-C3200 running pdaXrom beta3 and XFCE with a Planex WiFi CF card.

Slackware rules!

tesla_cubed

  • Newbie
  • *
  • Posts: 28
    • View Profile
    • http://
File Found But Not ?
« Reply #6 on: March 14, 2007, 09:19:33 am »
The ./work did the trick    I didnt ever think that it needed to be in the path to exe.  That would keep you from executing data by mastke, cool built in de-wormer   .

Thanks
Tesla^3
SL-C3200 (pdaXii)
AmbiCom Wifi
Belkin Palmtop ir keybord

sl-5500 (runing opie whatever.latest.release.is) -touchpanel
1gb SanDisk sd