<?xml version="1.0" encoding="iso-8859-1"?>
<rss version="2.0">
<channel>
  <title>Linux Format forums</title>
  <link>http://linuxformat.com/forums/index.php</link>
  <description>Help, discussion, magazine feedback and more</description>
  <language>english</language>
  <copyright>(c) Copyright Tue May 21, 2013 7:37 pm by Linux Format forums</copyright>
  <managingEditor>webmaster@linuxformat.com</managingEditor>
  <webMaster>webmaster@linuxformat.com</webMaster>
  <pubDate>Tue May 21, 2013 7:37 pm</pubDate>
  <lastBuildDate>Tue May 21, 2013 7:37 pm</lastBuildDate>
  <docs>http://backend.userland.com/rss</docs>
  <generator>phpBB2 RSS Syndication Mod by Lucas</generator>
  <ttl>1</ttl>

  <image>
    <title>Linux Format forums</title>
    <url></url>
    <link>http://linuxformat.com/forums/</link>
    <description>Help, discussion, magazine feedback and more</description>
  </image>

                                      <item>
                                        <title>RE: shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=1947#1947</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=-1'&gt;Anonymous&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Tue May 17, 2005 6:58 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Did you use chmod to make the script executable?</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=1947#1947</comments>
                                        <author>Anonymous</author>
                                        <pubDate>Tue May 17, 2005 6:58 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=1947#1947</guid>
                                      </item>
                                      <item>
                                        <title>RE: shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=943#943</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=-1'&gt;Anonymous&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 24, 2005 2:00 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      that looks as if you hit the nail on the head&lt;br /&gt;
&lt;br /&gt;
Thanks very much for your help</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=943#943</comments>
                                        <author>Anonymous</author>
                                        <pubDate>Sun Apr 24, 2005 2:00 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=943#943</guid>
                                      </item>
                                      <item>
                                        <title>RE: shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=941#941</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=123'&gt;fingers99&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 24, 2005 1:40 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      that &lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Quote:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;quote&quot;&gt; ^M: bad interpreter  &lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt; looks to me like a DOS end of line character. I'd take a look at it in vim and see if editing that out makes a difference.</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=941#941</comments>
                                        <author>fingers99</author>
                                        <pubDate>Sun Apr 24, 2005 1:40 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=941#941</guid>
                                      </item>
                                      <item>
                                        <title>RE: shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=939#939</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=-1'&gt;Anonymous&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 24, 2005 12:18 pm&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      No, the start line is in there.&lt;br /&gt;
I've compared the script with one of the ones that does run and I cant see any differences in them.&lt;br /&gt;
The problem seems to be the way that the hotplug event is handled and the call for the device script is made.&lt;br /&gt;
If I look at my logs I get this information&lt;br /&gt;
&lt;br /&gt;
Apr 24 11:53:36 marvin kernel: usb 1-2: Product: PocketPC SmartPhone&lt;br /&gt;
Apr 24 11:53:36 marvin kernel: usb 1-2: Manufacturer: Intel.&lt;br /&gt;
Apr 24 11:53:36 marvin kernel: usbserial 1-2:1.0: PocketPC PDA converter detected&lt;br /&gt;
Apr 24 11:53:36 marvin kernel: usb 1-2: PocketPC PDA converter now attached to ttyUSB0 (or usb/tts/0 for devfs)&lt;br /&gt;
Apr 24 11:53:36 marvin /etc/hotplug/usb.agent[7106]: need a device for this command&lt;br /&gt;
Apr 24 11:53:36 marvin /etc/hotplug/tty.agent[7108]: add tty device /class/tty/ttyUSB0&lt;br /&gt;
Apr 24 11:53:42 marvin /etc/hotplug/usb.agent[7106]: /etc/hotplug/usb.agent: /etc/hotplug/usb/synce: /bin/bash^M: bad interpreter: No such file or directory&lt;br /&gt;
&lt;br /&gt;
The script itself is &lt;br /&gt;
#!/bin/bash&lt;br /&gt;
&lt;br /&gt;
export time=`date +&quot;%b %d %X&quot;`&lt;br /&gt;
export uname=`uname -n`&lt;br /&gt;
&lt;br /&gt;
echo &quot;$time $uname $0: iPAQ added&quot; &amp;gt;&amp;gt; /var/log/synce&lt;br /&gt;
synce-serial-abort &amp;gt;&amp;gt; /dev/null&lt;br /&gt;
synce-serial-start &amp;gt;&amp;gt; /var/log/synce&lt;br /&gt;
&lt;br /&gt;
:&amp;gt; $REMOVER&lt;br /&gt;
echo &quot;export time=\`date +\&quot;%b %d %X\&quot;\`&quot; &amp;gt;&amp;gt; $REMOVER&lt;br /&gt;
echo &quot;export uname=\`uname -n\`&quot; &amp;gt;&amp;gt; $REMOVER&lt;br /&gt;
echo &quot;echo \&quot;\$time \$uname $0: iPAQ removed\&quot; &amp;gt;&amp;gt; /var/log/synce&quot; &amp;gt;&amp;gt; $REMOVER&lt;br /&gt;
chmod +x $REMOVER&lt;br /&gt;
&lt;br /&gt;
and its path is /etc/hotplug/usb/synce&lt;br /&gt;
&lt;br /&gt;
If I type the command /etc/hotplug/usb/synce then it doesnt run. If I type&lt;br /&gt;
bash /etc/hotplug/usb/synce then it will.&lt;br /&gt;
There are other almost identical scripts in the same directory that will run without the bash command</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=939#939</comments>
                                        <author>Anonymous</author>
                                        <pubDate>Sun Apr 24, 2005 12:18 pm</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=939#939</guid>
                                      </item>
                                      <item>
                                        <title>RE: shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=935#935</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=5'&gt;nelz&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 24, 2005 11:22 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      Itnsounds like you are missing the shebang line from the start of the script, although that can't be more than a guess because you have given no information about the script itself. The script should start with&lt;br /&gt;
&lt;br /&gt;
&lt;/span&gt;&lt;table width=&quot;90%&quot; cellspacing=&quot;1&quot; cellpadding=&quot;3&quot; border=&quot;0&quot; align=&quot;center&quot;&gt;&lt;tr&gt; 	  &lt;td&gt;&lt;span class=&quot;genmed&quot;&gt;&lt;b&gt;Code:&lt;/b&gt;&lt;/span&gt;&lt;/td&gt;	&lt;/tr&gt;	&lt;tr&gt;	  &lt;td class=&quot;code&quot;&gt;#!/bin/bash&lt;/td&gt;	&lt;/tr&gt;&lt;/table&gt;&lt;span class=&quot;postbody&quot;&gt;</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=935#935</comments>
                                        <author>nelz</author>
                                        <pubDate>Sun Apr 24, 2005 11:22 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=935#935</guid>
                                      </item>
                                      <item>
                                        <title>shell script problems</title>
                                        <link>http://linuxformat.com/forums/viewtopic.php?p=933#933</link>
                                        <description>&lt;br /&gt;
                                      Author: &lt;a href='http://linuxformat.com/forums/profile.php?mode=viewprofile&amp;u=-1'&gt;Anonymous&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
                                      Posted: Sun Apr 24, 2005 10:37 am&lt;br /&gt;&lt;br /&gt;
                                      &lt;br /&gt;&lt;br /&gt;
                                      I have a shell script that  runs automatically following a 'hotplug' event.&lt;br /&gt;
Leaving the hotplug to do its thing results in a 'bad interpereter' error. If I try to run the script just using the path ie&lt;br /&gt;
/etc/hotplug/usb/synce&lt;br /&gt;
it gives me the same error. &lt;br /&gt;
However using the bash command then it works ok. This makes me assume that the error is due to the system not understanding the script is a bash script&lt;br /&gt;
&lt;br /&gt;
The thing is that there are other scripts in that directory, doing the same job but for differnt equipment, that do not need the bash command to run.&lt;br /&gt;
&lt;br /&gt;
What do I need to do to get the script to run impliclty as a bash script rather than being explicit with the bash statement.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Any help would be great&lt;br /&gt;
&lt;br /&gt;
Chris</description>
                                        <comments>http://linuxformat.com/forums/viewtopic.php?p=933#933</comments>
                                        <author>Anonymous</author>
                                        <pubDate>Sun Apr 24, 2005 10:37 am</pubDate>
                                        <guid isPermaLink="true">http://linuxformat.com/forums/viewtopic.php?p=933#933</guid>
                                      </item></channel></rss>