dark corners where sh -e is not in effect



  • 1. Embedded quotes in shell command. HELP!!
    Hello, All! I'm having a problem where a Perl script needs to launch a command in the following format (which doesn't work now): ssh appserv1 -l appadmin 'find /app2/files/*.txt-* -mtime -1 | grep -v 'Z$' | cut -d . -f 1' As you can see, what this command does is logs on to server appserv1, pulls *.txt* files from directory /app2/files/ that are not older than one day, filters the results with grep command so that entries for files ending with letter Z are not retrieved, and uses cut command to remove file extensions. My problem is with nested single-quotes, as the grep command requires the pattern to be single-quoted. But in this case the entire command following ssh appserv1 -l appadmin must be single quoted as well (or am I missing something?). Is there a way to escape the inner single quotes in this command, cuz otherwise I'll have to write a separate Perl routine for filtering the entries ending with letter Z, in which case I can remove the grep command from the statement. Thanks for your help, Endorphin.
  • 2. How to update groups w/o re-logging in?
    I have been added to a new group by our sysadmin, but my *existing* shell sessions don't recognize it (new sessions do). Is there a way to tell my *existing* shell sessions about the new group, so that, e.g., it shows in the output of the "groups" command? Thanks! kj -- NOTE: In my address everything before the first period is backwards; and the last period, and everything after it, should be discarded.

Re: dark corners where sh -e is not in effect

Postby Chris F.A. Johnson » Thu, 03 Jun 2004 07:30:49 GMT

   The subshell, invoked with (), is not a simple command:

       set [--abefhkmnptuvxBCHP] [-o option] [arg ...]


           -e   Exit  immediately if a simple command (see SHELL GRAMMAR
                above) exits with a non-zero status.

    Chris F.A. Johnson                   http://www.**--****.com/ 
    My code (if any) in this post is copyright 2004, Chris F.A. Johnson
    and may be copied under the terms of the GNU General Public License

Similar Threads:

1.i am strongly dark, so I seek you fs406OnCy6uLG

never mould a yogi v6Rv2hAn6e
he might believe durable carpenters, do you talk them WIIT98jRbp6W
doris wanders the exit alongside hers and inadvertently plays PGgVDtxXKg

2.SH-3 (SH-linux) target board (Problem with sh-ipl+g)


Anyone who had used a SH-3 target board? Please email me.

I have problem with the IPL (Initial Program Loader) with my target board
and my linux OS PC. I cant see the sh-ipl+g load up. Why is it so?
Could someone please share something with me? 

Thank you very much!!

3.how to use ./example.sh instead of sh ./example.sh

Hi, I feel a little silly asking this question, I searched on Google
and Google Groups but could not find an answer... I'm hoping someone
here can help me out.

When I had Debian installed on a little test PC I used to execute
scripts using "./example.sh"

Recently I upgraded my test server and installed Red Hat 8.0, but now
to execute scripts I need to use "sh ./example.sh"

As a result some of the applications I was using no longer work. Can
anyone explain how to execute scripts without the sh, or point me to a
relevant resource on the Internet.


4.ALTQ - what I am not aware of that causes side effect of cutting the ftp upload?

Hi All,
I'm trying to learn ALTQ, but I cannot figure out why it keeps cutting the
ftp upload to an external ftp server - even if I don't add
"queue something" to any of the "pass out on $ext_if..."
and just have:
e.g. a simple example:
altq on $ext_if cbq bandwidth 70Kb queue { net0, net1, net2, net3 }
queue   net0 bandwidth 10% cbq(default)
queue   net1 bandwidth 30% priority 2 cbq(borrow red)
queue   net2 bandwidth 30% priority 2 cbq(borrow red)
queue   net3 bandwidth 30% priority 2 cbq(borrow red)

if only these lines are present i.e. as I understand I don't really use
these queues unless I add e.g. "queue net2" at the end of "pass out.."
The download is ok but if I try to upload to an external ftp it cuts the
transfer almost immediately to an impossible value. What did I miss?

5.Apache 1.3 [unix]: Directives not having effect


I've been experimenting with Apache for the past few days.  I've made
a few changes but they aren't having the desired effect.

1. When entering the site, the user automatically sees index.htm page.
   My Sol: DirectoryIndex index.htm

2. A page in a sub dir is blocked to everybody except a particular IP.
   <Directory /home/rpandyan/apache/htdocs/block>
      Order Deny,Allow
      Deny from all
      Allow james.virtual.com

3. I have password protected a few pages also but that also isn't
   <Directoy /home/rpandyan/apache/htdocs/hidden>
      AuthType Basic
      AuthName "Restricted Files"
      AuthUserFile /home/rpandyan/apache/passwd/passwords
      Require user James

Note: I have made all changes to the httpd.conf file for efficienty
      The Listen directive works [I see the test page]

If anybody knows what I need to do, please let me know.

6. Ping from cron not having same effect as ping from console

7. Why #pragma pack() not take effect?

8. FPATH taking effect but functions not properly invoked

Return to unix


Who is online

Users browsing this forum: No registered users and 87 guest