<?xml version="1.0" encoding="UTF-8"?>
<rdf:RDF xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns="http://purl.org/rss/1.0/" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:syn="http://purl.org/rss/1.0/modules/syndication/" xmlns:admin="http://webns.net/mvcb/">
  <channel rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting">
    <title>gmane.comp.shells.scripting</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting</link>
    <description/>
    <syn:updatePeriod>hourly</syn:updatePeriod>
    <syn:updateFrequency>1</syn:updateFrequency>
    <syn:updateBase>1901-01-01T00:00+00:00</syn:updateBase>
    <items>
      <rdf:Seq>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/925"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/924"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/923"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/922"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/921"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/920"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/919"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/918"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/917"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/916"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/915"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/914"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/913"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/912"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/911"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/910"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/909"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/908"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/907"/>
        <rdf:li rdf:resource="http://permalink.gmane.org/gmane.comp.shells.scripting/906"/>
      </rdf:Seq>
    </items>
    <image rdf:resource="http://gmane.org/img/gmane-25t.png"/>
    <textinput rdf:resource=""/>
  </channel>
  <image rdf:about="http://gmane.org/img/gmane-25t.png">
    <title>Gmane</title>
    <url>http://gmane.org/img/gmane-25t.png</url>
    <link>http://gmane.org</link>
  </image>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/925">
    <title>Re: Who's coding in what these days?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/925</link>
    <description>&lt;pre&gt;

I like bash a lot, too.  I use it for all of my scripting work, as well 
as for prototyping, doing "proof of concept" type things for projects 
that I'll eventually end up coding in C, which is definitely my preferred 
"real" language.

I've always been rather put off by perl's arcane syntactical elements.  
It's just really ugly to try to read.  :-)  As far as more modern, object-
oriented languages, I'm slowly (*very* slowly) assimilating C++, and a 
little Java, but I'm nowhere near proficient enough in either one for 
them to be of any practical use to me, yet.

So basically, yes, bash and C are my mainstays.  Both have served me well 
over the years, and still do.

&lt;/pre&gt;</description>
    <dc:creator>Conrad J. Sabatier</dc:creator>
    <dc:date>2012-04-27T16:19:44</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/924">
    <title>Re: Easier way to toggle comments?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/924</link>
    <description>&lt;pre&gt;2011-10-17, 04:23(+00), Mëa Cúlpa:
[...]

sed -e 's/^#//;t' -e 's/^/#/'

Or

awk '{print /^#/ ? substr($0,2) : "#" $0}'

&lt;/pre&gt;</description>
    <dc:creator>Stephane CHAZELAS</dc:creator>
    <dc:date>2011-10-17T08:49:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/923">
    <title>Re: Easier way to toggle comments?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/923</link>
    <description>&lt;pre&gt;Todd A. Jacobs &amp;lt;nospam-S/bPM5e9wgfNLxjTenLetw&amp;lt; at &amp;gt;public.gmane.org&amp;gt;:

Why not use printf instead of sub?

awk ' /^[^#]/ {printf("#%s\n", $0)}'

Regarding elegance,

A full-featured awk script is elegant enough. 
What else do you want if you have a line-based, regex-powered, 
C-flavoured Just-In-Time interpreter like AWK??


&lt;/pre&gt;</description>
    <dc:creator>Mëa Cúlpa</dc:creator>
    <dc:date>2011-10-17T04:23:58</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/922">
    <title>Re: bash (or other shell) help with usernames</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/922</link>
    <description>&lt;pre&gt;2011-07-19, 12:35(-07), Roger:
[...]

That's zsh syntax, not bash (though there are limits on the
format of username accepted, for instance a "a+b" user won't be
recognised)

You'd be better of using perl or another high level programming
language even if using touch to touch the file/dir.

#! /usr/bin/perl -w
foreach my $user (&amp;lt; at &amp;gt;ARGV) {
  my $home = (getpwnam($user))[7] or
    die "No such user $user or no home directory";
  system("touch", "--", "$home/FILENAME") == 0 or exit(1);
}

&lt;/pre&gt;</description>
    <dc:creator>Stephane CHAZELAS</dc:creator>
    <dc:date>2011-09-27T20:02:45</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/921">
    <title>Re: Network redirection in bash</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/921</link>
    <description>&lt;pre&gt;2011-04-10, 04:26(-07), Todd A. Jacobs:

It won't work for the same reason as

cat foo.doc /dev/tty | antiword -

won't output anything until you press Ctrl-D.

You'd need to shutdown the socket for sending first so that
antiword sees the end of file. Unfortunately, I don't think bash
allows you do close the sending and receiving side separately.
zsh's ztcp can't either as far as I can tell. You'd need to find
a way to tell antiword about the end of input another way.

You could for instance change it to accept uuencoded files and
handle the input with a wrapper script that does:

#! /usr/bin/awk -f
BEGIN{cmd="uudecode -o - | antiword -"}
{print | cmd}
/^end/{close(cmd)}

(untested).

&lt;/pre&gt;</description>
    <dc:creator>Stephane CHAZELAS</dc:creator>
    <dc:date>2011-09-27T19:40:24</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/920">
    <title>Re: Re: bash (or other shell) help with usernames</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/920</link>
    <description>&lt;pre&gt;

I think this will be it.  there are 2 different path possibilities,
one for students, the other for staff.  'touch' was an example, I'm
actually going to be setting permissions on a sub-directory in their
home directory when they connect via SMB or AFP.

&lt;/pre&gt;</description>
    <dc:creator>Roger</dc:creator>
    <dc:date>2011-07-21T15:03:13</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/919">
    <title>Re: bash (or other shell) help with usernames</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/919</link>
    <description>&lt;pre&gt;
This won't work because of the way that bash handles the quoting. You
could use eval:

eval "touch ~${1}/FILENAME"

so that the positional parameter is expanded and then re-processed as
a tilde expansion, but that's rather unsafe. You're better off hard-
coding the path to the home directory like so:

touch /home/${1}/FILENAME

which should be fine unless you have multiple homes for different
users (e.g. if you're using NFS, or have thousands of users and are
splitting home partitions onto different spindles for performance
reasons).

There are also other ways to get the home directory for a user that
don't require tilde expansion. For example, given a username of foo:

set -- foo
getent passwd $1 | cut -d: -f6

You could use that to build the path, which might be useful in the
event that you can't assume that the user's home directory will be
under /home.

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-07-20T23:27:36</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/918">
    <title>bash (or other shell) help with usernames</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/918</link>
    <description>&lt;pre&gt;Trying to do something simple, but it's not working.
Just trying to pass an argument (in this case a username), and have it
touch a file in that user's directory.
calling the script like this:
SCRIPTNAME  USERNAME

#!/bin/bash
touch ~$1/FILENAME


Does not work.  I get no such directory or file.  If I hard code in:
touch  ~USERNAME/FILENAME

Then it works.
If I call it with:
SCRIPTNAME   ~USERNAME    (Note the ~)

There must be something going on with passing in the username via the
command prompt and using that string with tilde expansion.

I'm trying to do something when a user connects to an SMB share on
linux.  I can retrieve the username via $U in the pre-exec area.  I
could add the full path in SMB.conf, but not all users are in the same
path for their home directories.   Using the tilde with their username
is best.

&lt;/pre&gt;</description>
    <dc:creator>Roger</dc:creator>
    <dc:date>2011-07-19T19:35:11</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/917">
    <title>Re: Display date between 2 giving date</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/917</link>
    <description>&lt;pre&gt;
You're printing the array directly with print_r, when what you really
want
to do is print each member of the array using a foreach loop.

See http://php.net/manual/en/control-structures.foreach.php for
details,
but this works fine from the command line:

  php -r '$a = array(1, 2, 3); foreach ($a as $value) {print "$value
\n";}'

Hope that helps!

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-07-05T00:53:59</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/916">
    <title>Display date between 2 giving date</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/916</link>
    <description>&lt;pre&gt;I have a problem with a PHP script to output date format according to
two dates. $fromDate and $toDate.
Let say if the date between is 6 i wanted to display  day 1 , day 2 ,
day3 .....day6.
I have a script that follows

 &amp;lt;?php
$fromDate = "07/20/2011"; // month / day / year
$toDate = "07/22/2011";  // month / day / year

$dateMonthYearArr = array();
$fromDateSTR = strtotime($fromDate);
$toDateSTR = strtotime($toDate);

for ($currentDateSTR = $fromDateSTR;
$currentDateSTR &amp;lt;= $toDateSTR;
$currentDateSTR += (60 * 60 * 24)) {
// use date() and $currentDateSTR to format the dates in between
$currentDateStr = date("Y-m-d",$currentDateSTR);
$dateMonthYearArr[] = $currentDateStr;
//print $currentDateStr."&amp;lt;br /&amp;gt;";
}

echo  "&amp;lt;pre&amp;gt;";
print_r($dateMonthYearArr);
echo "";

?&amp;gt;

the output is:

Array
(
    [0] =&amp;gt; 2011-07-20
    [1] =&amp;gt; 2011-07-21
    [2] =&amp;gt; 2011-07-22
)
 But i want something like
day1  2011-07-20
day2  2011.07-21
day3 2011-07-22
Your help will be appraciated!

&lt;/pre&gt;</description>
    <dc:creator>dovito</dc:creator>
    <dc:date>2011-06-09T15:49:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/915">
    <title>Re: Php image renaming</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/915</link>
    <description>&lt;pre&gt;You need to escape the apostrophe's in the user input. But you need to do other checks as well to make sure they don't use malicious input to compromise your system.

hth
charles

On Jun 4, 2011, at 10:21 PM, dovito wrote:



&lt;/pre&gt;</description>
    <dc:creator>Charles Galpin</dc:creator>
    <dc:date>2011-06-05T14:06:42</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/914">
    <title>Php image renaming</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/914</link>
    <description>&lt;pre&gt;I have a script for image upload and rename. Anytime I try to rename a
image with a name contaning an apostrophe I get something wrong. For
Exemple if I want to rename a image from "dream" to "dream's"  I get
an error. Can someone help? Thank you!

&lt;/pre&gt;</description>
    <dc:creator>dovito</dc:creator>
    <dc:date>2011-06-05T02:21:06</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/913">
    <title>Re: Network redirection in bash</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/913</link>
    <description>&lt;pre&gt;
As a sanity check, I tried this successfully:

  # XTerm 1
  nc -l 2100 | antiword - | nc -l 2101

  # XTerm 2
  # send file to antiword
  nc localhost 2100 &amp;lt; /tmp/foo.doc
  # read antiword's results
  nc localhost 2101

Since that works, I'm really pretty sure that I'm just failing to hook
up standard output or standard input correctly somewhere.

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-04-10T12:10:07</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/912">
    <title>Re: Network redirection in bash</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/912</link>
    <description>&lt;pre&gt;
Just in case I've done something stupid in xinetd, I thought I'd post
my configuration for that, too.

service antiword
{
disable= no
type= UNLISTED
id= antiword
flags+= NODELAY IPv4
socket_type= stream
protocol= tcp
user= nobody
group= nogroup
wait= no
nice= 10
env+= ANTIWORDHOME=/usr/share/antiword
port= 2100
server= /usr/bin/antiword
server_args= -
log_type= FILE /tmp/antiword.log
log_on_success+= EXIT DURATION
log_on_failure+= ATTEMPT
banner= /etc/motd
only_from= 127.0.0.1
}

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-04-10T11:35:03</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/911">
    <title>Network redirection in bash</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/911</link>
    <description>&lt;pre&gt;I'm trying something a little weird, and am not having much success
with my shell redirection to a network port. I'm trying to send an MS
Word file to antiword running out of inetd. Here's what I have on the
client side:

    exec 4&amp;lt;&amp;gt; /dev/tcp/127.0.0.1/2100
    cat /tmp/foo.doc &amp;gt;&amp;amp;4
    cat &amp;lt;&amp;amp;4

This seems like it should work, but I never get any results back from
antiword. Basically, it just waits until the service times out.

I'm hoping I'm just doing something wrong with my shell redirection
here. Thoughts?

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-04-10T11:26:23</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/910">
    <title>Re: Re: Challenges?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/910</link>
    <description>&lt;pre&gt;
My problem was due to confusion between multiple accounts and
was on my end, but I stumbled on the right incantation this time.
 

I'm using it on various servers doing data processing, where the code is
mostly in small, independent programs as opposed to larger monilithic
ones.  I guess the goal is to try to use the filesystem and process
model as directly as possible to store data and operate on them.

I recently made the type/class links fully symbolic, resolved at run
time, where formerly those links had to resolve statically to their
class directories.  Types can now include ordinary files in addition to
directories; e.g., a class can declare that a file foo will be a boolean
attribute, with methods to operate on foo found in a class directory.

The scheme is experimental and evolving, but is functional enough to
the extent I've used it.  In the process I've been doing a lot of bash
scripting, doing a lot with arrays, variable expansions, functions,
and so on, which would be stuff relevant for the scri&lt;/pre&gt;</description>
    <dc:creator>Ken Irving</dc:creator>
    <dc:date>2011-04-07T16:44:35</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/909">
    <title>Re: Challenges?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/909</link>
    <description>&lt;pre&gt;
I've had some messages "disappear" with Google Groups, too. It seems
highly unreliable sometimes.


I remember you talking about this sometime back. I don't think I ever
understood the utility of it, though.

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-04-07T13:48:56</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/908">
    <title>Re: Challenges?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/908</link>
    <description>&lt;pre&gt;
I've been doing a lot of bash scripting lately, but have been
unable to post to the list for some time.  Sending this after 
another round of trying to get google-groups to work, and maybe
it'll go this time...

I've been working on a system for some time using programs of
any sort as methods in an object-oriented system, with run-time
resolution of objects and methods.  The main program driving the
system is a bash script, built up from functions in a development
directory.  Along with this I've been using symlinks as variables, 
apparently an untapped resource.

Ken

&lt;/pre&gt;</description>
    <dc:creator>Ken Irving</dc:creator>
    <dc:date>2011-04-05T16:45:02</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/907">
    <title>Easier way to toggle comments?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/907</link>
    <description>&lt;pre&gt;I'm using the following to toggle lines on and off in my Ruby .gemrc
file:

    toggle-rdoc () {
        local FILE="$HOME/.gemrc"
        { rm $FILE &amp;amp;&amp;amp;
          awk '/^#/ {sub(/^#/, "", $0); print; next};
                  /^[^#]/ {sub(/^/, "#", $0); print}' &amp;gt; $FILE
        } &amp;lt; $FILE
        cat $FILE
    }

It works, but it just seems like there ought to be an easier way. I
couldn't get it to work with sed for some reason; it seems to need
some serious branching to work at all in sed. Here's what I tried in
sed:

    alias toggle-rdoc='sed -ri "/^#/{ s/^#// }; s/^([^#])/#\1/"
~/.gemrc; cat ~/.gemrc'

but the results are always the same; no toggling happens at all.
*sigh*

Can anyone think of a more elegant solution for this problem?

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-04-02T23:38:31</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/906">
    <title>tcltest?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/906</link>
    <description>&lt;pre&gt;Does anyone here know anything about tcltest? I ran across a reference
to it today while trying to find some resources for TDD in tcl/tk. Not
sure if it's suitable, so I thought I'd ask for opinions.

Recommended links for TDD with tcl/tk, anyone?

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-03-26T23:31:04</dc:date>
  </item>
  <item rdf:about="http://permalink.gmane.org/gmane.comp.shells.scripting/905">
    <title>Script or one-liner for bumping revision numbers?</title>
    <link>http://permalink.gmane.org/gmane.comp.shells.scripting/905</link>
    <description>&lt;pre&gt;I was noodling around today about ways to bump an arbitrarily-deep
revision number. By that, I mean a good perl (or whatever) one-liner
that doesn't care if the revision number is 7, 1.1, or 2.3.4, and can
just bump up the last digit in the sequence and write it back in-
place.

I have a complicated shell snippet that sort of works, but it's ugly
and inefficient. Anyone know of a reliable way to do this?

&lt;/pre&gt;</description>
    <dc:creator>Todd A. Jacobs</dc:creator>
    <dc:date>2011-03-24T11:06:18</dc:date>
  </item>
  <textinput rdf:about="http://search.gmane.org/?group=$group=gmane.comp.shells.scripting">
    <title>Search Engine</title>
    <description>Search the mailing list at Gmane</description>
    <name>query</name>
    <link>http://search.gmane.org/?group=$group=gmane.comp.shells.scripting</link>
  </textinput>
</rdf:RDF>

