<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with a variable in my short shell script in Operating System - Linux</title>
    <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040157#M95670</link>
    <description>Aloha Folks,&lt;BR /&gt;&lt;BR /&gt;You folks are the best! Sure enough, the source of my woes was my new windows ssh ftp client that I was using... it was embedding garbage windows esc sequenses in all of my scripts. I fixed them in vi and all is well again. You folks are a real credit to the forums and I humbly thank you each and every one, for your rapid and thoughtful responses. Please take care folks!&lt;BR /&gt;&lt;BR /&gt;Very Respectfully,&lt;BR /&gt;Chris Elmore</description>
    <pubDate>Sat, 14 Apr 2007 20:36:23 GMT</pubDate>
    <dc:creator>Chris Elmore</dc:creator>
    <dc:date>2007-04-14T20:36:23Z</dc:date>
    <item>
      <title>Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040151#M95664</link>
      <description>Aloha Folks,&lt;BR /&gt;&lt;BR /&gt;I am having some trouble with a basic shell script I am drafting and the error that is produced when I execute the script is this:&lt;BR /&gt;&lt;BR /&gt;./Trp_Extract.sh[2]: TROUPERS^M: This is not an identifier.&lt;BR /&gt;&lt;BR /&gt;The first 2 lines of the shell script sets a variable:&lt;BR /&gt;&lt;BR /&gt;TROUPERS=/home/TROUPERS&lt;BR /&gt;export TROUPERS&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;The file is set to 777. Any ideas folks? Thanks in advance.&lt;BR /&gt;&lt;BR /&gt;Very Respectfully,&lt;BR /&gt;Chris Elmore</description>
      <pubDate>Sat, 14 Apr 2007 15:56:04 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040151#M95664</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2007-04-14T15:56:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040152#M95665</link>
      <description>Let the very 1st line of your script be:&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;&lt;BR /&gt;export TROUPERS=/home/TROUPERS&lt;BR /&gt;&lt;BR /&gt;It's always wise to use a "shbang" line in a script so that the system knows which executable to run your script against (POSIX/Bourne/Korn shell, perl, awk, ...).</description>
      <pubDate>Sat, 14 Apr 2007 16:06:12 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040152#M95665</guid>
      <dc:creator>A. Clay Stephenson</dc:creator>
      <dc:date>2007-04-14T16:06:12Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040153#M95666</link>
      <description>Aloha Mr. Stephenson,&lt;BR /&gt;&lt;BR /&gt;Good to chat with you again! I tried using the shbang and this is what I get:&lt;BR /&gt;&lt;BR /&gt;interpreter "/usr/bin/sh" not found&lt;BR /&gt;sh: Trp_Extract.sh:  not found.&lt;BR /&gt;&lt;BR /&gt;Any ideas what I'm doing wrong?&lt;BR /&gt;&lt;BR /&gt;v/r,&lt;BR /&gt;Chris</description>
      <pubDate>Sat, 14 Apr 2007 16:13:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040153#M95666</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2007-04-14T16:13:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040154#M95667</link>
      <description>Aloha Clay,&lt;BR /&gt;&lt;BR /&gt;Your export syntax was spot on! The variables are setting correctly now. I was going off of an older install doc and the format must not be compatible with our newer OS. Thanks a bunch! I still can't get the shbang to set though. Any ideas!&lt;BR /&gt;&lt;BR /&gt;Your the BEST!&lt;BR /&gt;&lt;BR /&gt;v/r,&lt;BR /&gt;Chris</description>
      <pubDate>Sat, 14 Apr 2007 16:20:53 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040154#M95667</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2007-04-14T16:20:53Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040155#M95668</link>
      <description>Did you edit this script on a MS-Windows computer and then moved it to a HP-UX? &lt;BR /&gt;&lt;BR /&gt;The '^M' suggests that there may be Windows-style end-of-line characters in the script that are confusing the shell.&lt;BR /&gt;&lt;BR /&gt;If you use FTP to transfer the script from MS-Windows to HP-UX, remember to use ASCII transfer mode when transferring scripts. This will handle the line ending character conversion automatically.&lt;BR /&gt;&lt;BR /&gt;Your script is apparently named "Trp_Extract.sh". Please run "dos2ux Trp_Extract.sh" to convert the line ending characters to Unix style.&lt;BR /&gt;&lt;BR /&gt;By the way, it's a very bad habit to set file permissions to 777 whenever there's a problem. Someone may add a few commands of his/her own into your script... and when you run it, they are executed using your identity. A smart intruder uses this to build him/herself a back door to your account and then restore your original script.&lt;BR /&gt;&lt;BR /&gt;755 is enough for a script. If it needs to be maintained by a group of people, then 775. Never 777.&lt;BR /&gt;&lt;BR /&gt;MK</description>
      <pubDate>Sat, 14 Apr 2007 16:33:35 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040155#M95668</guid>
      <dc:creator>Matti_Kurkela</dc:creator>
      <dc:date>2007-04-14T16:33:35Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040156#M95669</link>
      <description>Aloha,&lt;BR /&gt;&lt;BR /&gt;/usr/bin/sh not found tells me that you might not be using HP-UX.  If /usr/bin/sh were not on your HP-UX system then you would have a LOT of issues.&lt;BR /&gt;&lt;BR /&gt;What operating system are you using?&lt;BR /&gt;&lt;BR /&gt;Also, the line MUST be the very first line in the script  and must be exactly as Clay posted it and it must start at the very beginning of the line.&lt;BR /&gt;&lt;BR /&gt;# cat script&lt;BR /&gt;#!/usr/bin/sh&lt;BR /&gt;export VAR=somevalue&lt;BR /&gt;...&lt;BR /&gt;...&lt;BR /&gt;</description>
      <pubDate>Sat, 14 Apr 2007 16:35:21 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040156#M95669</guid>
      <dc:creator>Patrick Wallek</dc:creator>
      <dc:date>2007-04-14T16:35:21Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with a variable in my short shell script</title>
      <link>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040157#M95670</link>
      <description>Aloha Folks,&lt;BR /&gt;&lt;BR /&gt;You folks are the best! Sure enough, the source of my woes was my new windows ssh ftp client that I was using... it was embedding garbage windows esc sequenses in all of my scripts. I fixed them in vi and all is well again. You folks are a real credit to the forums and I humbly thank you each and every one, for your rapid and thoughtful responses. Please take care folks!&lt;BR /&gt;&lt;BR /&gt;Very Respectfully,&lt;BR /&gt;Chris Elmore</description>
      <pubDate>Sat, 14 Apr 2007 20:36:23 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-linux/problem-with-a-variable-in-my-short-shell-script/m-p/5040157#M95670</guid>
      <dc:creator>Chris Elmore</dc:creator>
      <dc:date>2007-04-14T20:36:23Z</dc:date>
    </item>
  </channel>
</rss>

