Linux segmentation fault message

Eric Shubert ejs at shubes.net
Sat Jun 22 12:09:46 MST 2013


On 06/22/2013 10:05 AM, joe at actionline.com wrote:
>
> 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
>

Begin with the file name. q-hid or qhid?


-- 
-Eric 'shubes'


More information about the PLUG-discuss mailing list