Re: [newbie] Help running shell script
I found something in dmesg: grsec: denied exec of ./build.sh by (bash:18269) UID(501) EUID(501), parent (bash:21641) UID(501) EUID(501) reason: untrusted On Sunday 08 February 2004 06:12 pm, robin wrote: Marty Phee wrote: I've had this problem with other scripts before and it's driving me nuts. I'm trying to compile jetspeed web portal. The script is build.sh and is in the directory ~/apps/jetspeed-1.4/build/build.sh. The mode on the file is: -rwxrwxrwx I changed it to chmod 777 just to try to get it to work. It isn't in DOS format either. I check that. Here are the first couple lines. #!/bin/sh # The name of the build file to use BUILDFILE=build.xml # Root directory for the project PROJECTDIR=.. . . . After I type ./build.sh I get: : bad interpreter: Permission denied If I do: sh ./build.sh I get: : command not found : command not found : command not found : command not found: : command not found: : command not found: : command not found: : command not found: '/build.sh: line 54: syntax error near unexpected token `do '/build.sh: line 54: `do I do develope in UNIX and haven't had problems like this. Other things work fine. It's not every script file. JBoss 3.2.3 run.sh works fine, but JBoss 3.0.6 requires sh run.sh. I tried to create a test script: #!/bin/sh echo Hello World I get the same error: bash: ./test.sh: /bin/sh: bad interpreter: Permission denied Try changing the line to #!/bin/bash Sir Robin Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help running shell script
How do I make it trusted? On Sunday 08 February 2004 06:49 pm, Marty Phee wrote: I found something in dmesg: grsec: denied exec of ./build.sh by (bash:18269) UID(501) EUID(501), parent (bash:21641) UID(501) EUID(501) reason: untrusted On Sunday 08 February 2004 06:12 pm, robin wrote: Marty Phee wrote: I've had this problem with other scripts before and it's driving me nuts. I'm trying to compile jetspeed web portal. The script is build.sh and is in the directory ~/apps/jetspeed-1.4/build/build.sh. The mode on the file is: -rwxrwxrwx I changed it to chmod 777 just to try to get it to work. It isn't in DOS format either. I check that. Here are the first couple lines. #!/bin/sh # The name of the build file to use BUILDFILE=build.xml # Root directory for the project PROJECTDIR=.. . . . After I type ./build.sh I get: : bad interpreter: Permission denied If I do: sh ./build.sh I get: : command not found : command not found : command not found : command not found: : command not found: : command not found: Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help running shell script
Marty Phee wrote: I found something in dmesg: grsec: denied exec of ./build.sh by (bash:18269) UID(501) EUID(501), parent (bash:21641) UID(501) EUID(501) reason: untrusted Maybe it's the directory the script is stored in. I've never run Mdk with security set to high, but it might only be allowing executables to be run from the usual places (/bin, /user/bin etc.). Just a guess, Sir Robin -- Man will occasionally stumble over the truth, but most of the time he will pick himself up and continue on. - Winston Churchill Robin Turner IDMYO Bilkent Univeritesi Ankara 06533 Turkey www.bilkent.edu.tr/~robin Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help with a script
Tony, Substitute each string of binary characters with a newline character. Substitute multiple newline characters with a single newline character. That will put the text strings one per line. Miark On Wed, 20 Aug 2003 09:06:26 +0100, Tony S. Sykes [EMAIL PROTECTED] wrote: Thanks for the replies, but I don't think I covered the search fully. The data I am searching for can be anywhere on the line, and the line can be very large so I can't cut it. I am searching for data, but I don't know what the data is. I know what it starts with and what it ends with. example @(#) data so I need to be able to cut upto the @(#) and then after the first . This could also appear a few times in the same file but with different data. I have tried grepping and putting '...' in place but the data is variable in size, so I can get a lot of rubbish after the . I will start to look into sed. Thanks all, Tony. -Original Message- From: Miark [mailto:[EMAIL PROTECTED] Sent: Tuesday, August 19, 2003 4:47 PM To: [EMAIL PROTECTED] Subject: Re: [newbie] Help with a script In Perl I would use a regular expression to match the text, then end up with the string you're looking for in $1. So, for instance #!/usr/bin/perl open FILE, filename; while (FILE) { m/exp_here/; print I found '$1'\n; } close FILE; Miark On Tue, 19 Aug 2003 16:05:31 +0100, Tony S. Sykes [EMAIL PROTECTED] wrote: All, I am struggling writing a script which greps a binary file (grep -a) which will remove all of the data before the characters I am looking for and then to remove the data after another character so I have only the relevant info. When you grep the binary file the line is very long. I am looking for only about 15 - 20 characters off the line. The problem is that it can be anywhere on the line so I can't use a simple cut. Would ed be able to do this? I am not looking for you to write the script, just pointers as to what commands I could use. So far I have got the grep done grep -a '@(#)' file but it's what I do to the line after that. Thanks in advance, Tony. -+-+-+-+-+-+-+- Business Computer Projects - Disclaimer -+-+-+-+-+-+-+- This message, and any associated attachment is confidential. If you have received it in error, please delete it from your system, do not use or disclose the information in any way, and notify either Tony S. Sykes or the postmaster mailto:[EMAIL PROTECTED] immediately. The contents of this message may contain personal views which are not necessarily the views of Business Computer Projects Ltd., unless specifically stated. Whilst every effort has been made to ensure that emails and their attachments are virus free, it is the responsibility of the recipient(s) to verify the integrity of such emails. Business Computer Projects Ltd BCP House 151 Charles Street Stockport Cheshire SK1 3JY Tel: +44 (0)161 355-3000 Fax: +44 (0)161 355-3001 Web: http://www.bcpsoftware.com http://www.bcpsoftware.com/ Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help with a script
On Tue, Aug 19, 2003 at 04:05:31PM +0100, Tony S. Sykes wrote: All, I am struggling writing a script which greps a binary file (grep -a) which will remove all of the data before the characters I am looking for and then to remove the data after another character so I have only the relevant info. When you grep the binary file the line is very long. I am looking for only about 15 - 20 characters off the line. The problem is that it can be anywhere on the line so I can't use a simple cut. Would ed be able to do this? I am not looking for you to write the script, just pointers as to what commands I could use. So far I have got the grep done grep -a '@(#)' file but it's what I do to the line after that. Thanks in advance, Tony. You can do this with sed I know as I was just looking to do something similar. I don't have time right now, but I'll have a look through my bookmarks and notes later tonight. Todd Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help with a script
On Tue, 2003-08-19 at 17:05, Tony S. Sykes wrote: ed be able to do this? I am not looking for you to write the script, just pointers as to what commands I could use. So far I have got the grep done grep -a '@(#)' file but it's what I do to the line after that. Perhaps it is an idea to limit the length of the remaining file to about 100 chars by piping the result of grep to cut? And from there you could use sed or ed to snip out what you need. Paul -- A good programmer is someone who looks both ways before crossing a one-way street. - Doug Linder http://www.nlpagan.net - Linux Mandrake - Ximian Evolution Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com
Re: [newbie] Help with a script
In Perl I would use a regular expression to match the text, then end up with the string you're looking for in $1. So, for instance #!/usr/bin/perl open FILE, filename; while (FILE) { m/exp_here/; print I found '$1'\n; } close FILE; Miark On Tue, 19 Aug 2003 16:05:31 +0100, Tony S. Sykes [EMAIL PROTECTED] wrote: All, I am struggling writing a script which greps a binary file (grep -a) which will remove all of the data before the characters I am looking for and then to remove the data after another character so I have only the relevant info. When you grep the binary file the line is very long. I am looking for only about 15 - 20 characters off the line. The problem is that it can be anywhere on the line so I can't use a simple cut. Would ed be able to do this? I am not looking for you to write the script, just pointers as to what commands I could use. So far I have got the grep done grep -a '@(#)' file but it's what I do to the line after that. Thanks in advance, Tony. Want to buy your Pack or Services from MandrakeSoft? Go to http://www.mandrakestore.com