<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: problem with writing a wrapper in Operating System - HP-UX</title>
    <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907329#M106352</link>
    <description>If your users don't understand how to run commands under a shell and how the rules with wildcard expansion work, then I would suggest you create a wrapper program that provides them a menu of tasks.&lt;BR /&gt;&lt;BR /&gt;This way the user input can be controlled.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
    <pubDate>Tue, 18 Feb 2003 19:24:10 GMT</pubDate>
    <dc:creator>Rodney Hills</dc:creator>
    <dc:date>2003-02-18T19:24:10Z</dc:date>
    <item>
      <title>problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907325#M106348</link>
      <description>Hi all,&lt;BR /&gt;I'm writing a wrapper for crontab command like below:&lt;BR /&gt;&lt;BR /&gt;--------------------------------------------&lt;BR /&gt;#!/usr/bin/sh &lt;BR /&gt;# &lt;BR /&gt;# Replace crontab with a wrapper &lt;BR /&gt;# Written by M.B. &lt;BR /&gt;#&lt;BR /&gt;&lt;BR /&gt;if [ `expr index "$1" "[\*,\?]"` -ne 0 ] &lt;BR /&gt;&lt;BR /&gt;then&lt;BR /&gt;         echo "Usage: crontab -l  | -v  | -r  | -e [username]"&lt;BR /&gt;         exit 1&lt;BR /&gt;else&lt;BR /&gt;         exec /usr/bin/crontab.orig "$@" &lt;BR /&gt;fi&lt;BR /&gt;-----------------------------------------&lt;BR /&gt;&lt;BR /&gt;But I have a problem,&lt;BR /&gt;when passing parameters to the script for example like "*a", if there is a file name ending with a (e.g baa), $1 value is "baa" not "*a", or another example, &lt;BR /&gt;let say that parameter is ?l, and if there is a file named ll, then $1 value is "ll" not "?l"!&lt;BR /&gt;&lt;BR /&gt;I want to see the real values of the parameters in order to check if there is an incorrect value in the parameter.&lt;BR /&gt;&lt;BR /&gt;How can I solve this problem?&lt;BR /&gt;&lt;BR /&gt;Urgent!!!&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Feb 2003 18:38:33 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907325#M106348</guid>
      <dc:creator>Onur Sirin_1</dc:creator>
      <dc:date>2003-02-18T18:38:33Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907326#M106349</link>
      <description>Standard shell interpolation is overridden by "quoting" the arguments, ie&lt;BR /&gt;&lt;BR /&gt;crontab '*a'&lt;BR /&gt;&lt;BR /&gt;This will prevent the shell from expanding the wildcard. You may also use the backslash, ie&lt;BR /&gt;&lt;BR /&gt;crontab \*a&lt;BR /&gt;&lt;BR /&gt;HTH&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 18 Feb 2003 18:43:40 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907326#M106349</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-02-18T18:43:40Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907327#M106350</link>
      <description>exec /usr/bin/crontab.orig "$@"&lt;BR /&gt;&lt;BR /&gt;groups all your args together to one single arg. Drop the (double) quotes.&lt;BR /&gt;&lt;BR /&gt;I also dislike the use of 'else' after exit/exec, because it will never be executed as such&lt;BR /&gt;&lt;BR /&gt;if [ $# -lt 1 -o `expr index "$1" "[\*,\?]"` -ne 0 ]; then &lt;BR /&gt;echo "Usage: crontab -l | -v | -r | -e [username]" &lt;BR /&gt;exit 1 &lt;BR /&gt;fi&lt;BR /&gt;&lt;BR /&gt;exec /usr/bin/crontab.orig $@&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Enjoy, have FUN! H.Merijn</description>
      <pubDate>Tue, 18 Feb 2003 18:48:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907327#M106350</guid>
      <dc:creator>H.Merijn Brand (procura</dc:creator>
      <dc:date>2003-02-18T18:48:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907328#M106351</link>
      <description>Hi again,&lt;BR /&gt;Thanks very much for your answers.&lt;BR /&gt;Procura, I corrected the mistakes, thanks.&lt;BR /&gt;Rodney, &lt;BR /&gt;I have still the problem.&lt;BR /&gt;You wrote that I can use&lt;BR /&gt;"crontab \*" etc.&lt;BR /&gt;Yes I know it, but my users don't know. They can write crontab *l by mistake and they lose their original crontab file.&lt;BR /&gt;Therefore I want to prevent them doing mistakes by a wrapper.&lt;BR /&gt;But how can I pass a parameter including * or ?to the $1 like it's original value?&lt;BR /&gt;&lt;BR /&gt;Thanks very much!&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Feb 2003 18:59:14 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907328#M106351</guid>
      <dc:creator>Onur Sirin_1</dc:creator>
      <dc:date>2003-02-18T18:59:14Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907329#M106352</link>
      <description>If your users don't understand how to run commands under a shell and how the rules with wildcard expansion work, then I would suggest you create a wrapper program that provides them a menu of tasks.&lt;BR /&gt;&lt;BR /&gt;This way the user input can be controlled.&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 18 Feb 2003 19:24:10 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907329#M106352</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-02-18T19:24:10Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907330#M106353</link>
      <description>&lt;BR /&gt;:))),&lt;BR /&gt;Rodney, I agree with you but this still doesn't change the fact that I must do this.&lt;BR /&gt;&lt;BR /&gt;Best regards&lt;BR /&gt;&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Feb 2003 19:40:13 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907330#M106353</guid>
      <dc:creator>Onur Sirin_1</dc:creator>
      <dc:date>2003-02-18T19:40:13Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907331#M106354</link>
      <description>Your problem is not solvable by the wrapper. It's the calling shell that expands your wildcards. You may disable the filename generation by adding "set -f" to the user's .profile or /etc/profile.&lt;BR /&gt;&lt;BR /&gt;Look, how the echo command is called:&lt;BR /&gt;&lt;BR /&gt;$ echo .pro*&lt;BR /&gt;.profile&lt;BR /&gt;&lt;BR /&gt;$ set -f&lt;BR /&gt;$ echo .pro*&lt;BR /&gt;.pro*&lt;BR /&gt;&lt;BR /&gt;Best regards...&lt;BR /&gt; Dietmar.</description>
      <pubDate>Tue, 18 Feb 2003 19:41:28 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907331#M106354</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2003-02-18T19:41:28Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907332#M106355</link>
      <description>Dietmer,&lt;BR /&gt;&lt;BR /&gt;I agree, your solution is probabily the best.&lt;BR /&gt;&lt;BR /&gt;Now as long as the user don't use some of the other "special" shell characters (like #, $, etc) they should be ok....  :-)&lt;BR /&gt;&lt;BR /&gt;-- Rod Hills</description>
      <pubDate>Tue, 18 Feb 2003 19:46:00 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907332#M106355</guid>
      <dc:creator>Rodney Hills</dc:creator>
      <dc:date>2003-02-18T19:46:00Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907333#M106356</link>
      <description>Thanks Dietmer,&lt;BR /&gt;I'll try it.&lt;BR /&gt;&lt;BR /&gt;Thanks all the others for their effort.&lt;BR /&gt;&lt;BR /&gt;Best regards.&lt;BR /&gt;</description>
      <pubDate>Tue, 18 Feb 2003 20:10:09 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907333#M106356</guid>
      <dc:creator>Onur Sirin_1</dc:creator>
      <dc:date>2003-02-18T20:10:09Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907334#M106357</link>
      <description>But prepared for complaints like: "Hey, Melike! My 'ls *.txt' does not work anymore!" :-)</description>
      <pubDate>Tue, 18 Feb 2003 20:15:47 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907334#M106357</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2003-02-18T20:15:47Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907335#M106358</link>
      <description>Hi again,&lt;BR /&gt;I can disable the wildcards file naming with using "set -f" command, &lt;BR /&gt;but how can I enable it again?&lt;BR /&gt;&lt;BR /&gt;Thankss</description>
      <pubDate>Wed, 19 Feb 2003 10:32:03 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907335#M106358</guid>
      <dc:creator>Onur Sirin_1</dc:creator>
      <dc:date>2003-02-19T10:32:03Z</dc:date>
    </item>
    <item>
      <title>Re: problem with writing a wrapper</title>
      <link>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907336#M106359</link>
      <description>set +f</description>
      <pubDate>Wed, 19 Feb 2003 10:42:59 GMT</pubDate>
      <guid>https://community.hpe.com/t5/operating-system-hp-ux/problem-with-writing-a-wrapper/m-p/2907336#M106359</guid>
      <dc:creator>Dietmar Konermann</dc:creator>
      <dc:date>2003-02-19T10:42:59Z</dc:date>
    </item>
  </channel>
</rss>

