Linux segmentation fault message SOLVED

joe at actionline.com joe at actionline.com
Sat Jun 22 16:37:32 MST 2013


Thank you Rusty, Matt, Eric, (and all)!

I *luv* this PLUG group!

Rusty: Adding that 'hashbang' line solved the problem
and now it works perfectly.

Eric, while 'qhid' and 'q-hid' were inconsistent in
my original message, I actually did have those sync'd
in my filename and code-script.

Matt: thanks for the tip re -i replacing -y
What is the purpose of that change?
Also, how can I modify the script so that "Search word(s)"
and "Here are the first results" can be on the same line?

Thanks again to all.

Joe

----------
> Have not read the script closely yet, but first thing I noticed is that
> you left off the first line:
>
> #!/bin/bash
>
> Which tells the computer to use BASH to run this.  I'm jumping to the
> conclusion that you aren't using the same shell on the web host as you
> are at home (or wherever).
>
> This line has to be the first line, and must start with 'hashbang'
> ('#!')  I think you are allowed a space (possibly more than one) between
> the ! and the path to the program you want to use as the interpreter....
> But I always leave it out because I know it works ;-)
>
> Rusty
>
>> -----Original Message-----
>> From: plug-discuss-bounces at lists.phxlinux.org [mailto:plug-discuss-
>> bounces at lists.phxlinux.org] On Behalf Of joe at actionline.com
>> Sent: Saturday, June 22, 2013 10:06 AM
>> To: plug-discuss at lists.phxlinux.org
>> Subject: Linux segmentation fault message
>>
>>
>> I have uploaded a small shell script and two related files to my Linux
>> web host.
>>
>> -rw-r--r-- 279120 qhid    . . . the text file to search
>> -rwxr-xr-x    554 qsearch . . . the shell script
>> -rw-rw-rw-      0 tempz   . . . a temporary file to hold search
> results
>>
>> 'qsearch' works fine on my local computers, but when I try to run it
> on
>> my web host I see this error message:
>>
>> ~(location) line 6: 26955 Done
>>        fgrep -y "$name1" q-hid
>>      26956 Segmentation fault | fgrep -y "$name2" > tempz
>>
>> What do I need to fix to get this to work?
>>
>> Here's the script:
>>
>> while (:) do
>> echo -e "Press S to search >>> \c"; ans=`readin`; echo; case $ans in
>>   [sS]) echo -e "Find what word? \c";read name1
>>         echo -e "and what second word? \c";read name2
>>         fgrep -y "$name1" q-hid | fgrep -y "$name2" > tempz
>>         cls; echo -e "\nSearch word(s): $name1 $name2";
>>         echo "Here are the first 10 results found:"; echo
>>         head -10 tempz; echo;;
>>   [qQ]) cls; echo; exit;;
>>   *) cls; echo "Not a valid option."; echo;; esac done
>>
>>
>>
>>
>>
>> ---------------------------------------------------
>> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org To
>> subscribe, unsubscribe, or to change your mail settings:
>> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
> ---------------------------------------------------
> PLUG-discuss mailing list - PLUG-discuss at lists.phxlinux.org
> To subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss
>




More information about the PLUG-discuss mailing list