RE: Linux segmentation fault message

Top Page
Attachments:
Message as email
+ (text/plain)
Delete this message
Reply to this message
Author: Carruth, Rusty
Date:  
To: Main PLUG discussion list
New-Topics: RE: Linux segmentation fault message SOLVED
Subject: RE: Linux segmentation fault message
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: [mailto:plug-discuss-
> ] On Behalf Of
> Sent: Saturday, June 22, 2013 10:06 AM
> To:
> 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 - To
> subscribe, unsubscribe, or to change your mail settings:
> http://lists.phxlinux.org/mailman/listinfo/plug-discuss

---------------------------------------------------
PLUG-discuss mailing list -
To subscribe, unsubscribe, or to change your mail settings:
http://lists.phxlinux.org/mailman/listinfo/plug-discuss