On 5 November 2017 at 19:17, wrote:
>
> Note that the mount(8) man page recommends findmnt(8) for script
> usage. Findmnt is util-linux, so whether you want to use it or
> not will depend a bit on your portability needs.
>
> Parsing mount output robustly is, of course, always a good exercise.
Ah
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1
On Sun, Nov 05, 2017 at 08:31:00AM +1100, David Margerison wrote:
> On 5 November 2017 at 04:55, wrote:
>
> > What about checking whether the
> > filesystem of a specific device is mounted at that directory? Can
> > that be checked easily?
>
> It
On 5 November 2017 at 08:31, David Margerison
wrote:
>
> Demo example from an interactive bash command line on this PC:
>
> $ devname=/dev/sda6 ; dirname=/mnt/p/A ; if mount | grep -q --
> "$devname on $dirname" ; then echo "$devname is mounted on $dirname" ;
> fi
The above command is unclear bec
On 5 November 2017 at 04:55, wrote:
> What about checking whether the
> filesystem of a specific device is mounted at that directory? Can
> that be checked easily?
It can be done by inspecting the output of the 'mount' command.
But keep in mind that the detail of this output may not be stable
* From: Roberto C. Sánchez
* Date: Wed, 25 Oct 2017 21:23:14 -0400
> The return status is seen by the shell as a numeric. ...
* From: Kushal Kumaran
* Date: Thu, 26 Oct 2017 07:01:30 +0530
> write it like this: ... See man test(1) for details.
* From: David Margeri
2017 08:12:16
From: David Margerison
To: "debian-user@lists.debian.org"
Subject: Re: bash usage.
Resent-Date: Thu, 26 Oct 2017 12:30:18 + (UTC)
Resent-From: debian-user@lists.debian.org
On 26 October 2017 at 21:59, Roberto C. S?nchez wrote:
On Thu, Oct 26, 2017 at 04:19:42
On Thu, Oct 26, 2017 at 11:12:16PM +1100, David Margerison wrote:
>
> That's a fair point, but the documentation of the 'if' statement in 'man bash'
> will make that immediately clear to anyone who cares to read it.
>
You must regularly deal with different sorts of people than I do :-)
> The [[
On 26 October 2017 at 21:59, Roberto C. Sánchez wrote:
> On Thu, Oct 26, 2017 at 04:19:42PM +1100, David Margerison wrote:
>> On 26 October 2017 at 12:23, Roberto C. Sánchez wrote:
>> >
>> > mountpoint -q $WorkingDirectory
>> > if [[ $? = 0 ]]
>>
>> That will work, but is ridiculous considering t
On Thu, Oct 26, 2017 at 04:19:42PM +1100, David Margerison wrote:
> On 26 October 2017 at 11:39, wrote:
> >
> > According to 'man mountpoint', it returns 0 if something is mounted.
> > So why the complaint from
> > if [ mountpoint $WorkingDirectory ] ?
>
> Answered here:
>
> http://mywiki.woo
On 26 October 2017 at 11:39, wrote:
>
> According to 'man mountpoint', it returns 0 if something is mounted.
> So why the complaint from
> if [ mountpoint $WorkingDirectory ] ?
Answered here:
http://mywiki.wooledge.org/BashPitfalls#if_.5Bgrep_foo_myfile.5D
http://mywiki.wooledge.org/BashGuid
pe...@easthope.ca writes:
> PROBLEM
> Given a storage device, /dev/GRN, and mount point, /home/peter/testdir/,
> determine in a shell script whether /dev/GRN is mounted or something is
> mounted on /home/peter/testdir/.
>
> ATTEMPTED SOLUTION
> Create testdir and execute this script.
>
> #!/bin/
On Wed, Oct 25, 2017 at 05:39:35PM -0700, pe...@easthope.ca wrote:
>
> According to 'man mountpoint', it returns 0 if something is mounted.
> So why the complaint from
> if [ mountpoint $WorkingDirectory ] ?
>
The return status is seen by the shell as a numeric. It is not coerced
to a bo
PROBLEM
Given a storage device, /dev/GRN, and mount point, /home/peter/testdir/,
determine in a shell script whether /dev/GRN is mounted or something is
mounted on /home/peter/testdir/.
ATTEMPTED SOLUTION
Create testdir and execute this script.
#!/bin/bash
# Demonstrate use of "mountpoint" in a
On Mon, Oct 13, 2014 at 10:53 PM, Chris Bannister
wrote:
> On Mon, Oct 13, 2014 at 02:10:11PM +0900, Joel Rees wrote:
>> >>
>> >> Which is another way of saying that you want others to have already made
>> >> the mistakes for you.
>> >
>> > No it isn't! Ponder why most people take their car to a
On Mon, Oct 13, 2014 at 02:10:11PM +0900, Joel Rees wrote:
> >>
> >> Which is another way of saying that you want others to have already made
> >> the mistakes for you.
> >
> > No it isn't! Ponder why most people take their car to a mechanic for
> > servicing.
>
> And you snipped:
>
> >> As long
On Mon, Oct 13, 2014 at 1:38 PM, Chris Bannister
wrote:
> On Mon, Oct 13, 2014 at 07:53:03AM +0900, Joel Rees wrote:
>> 2014/10/13 2:14 "Andrei POPESCU" :
>> >
>> > On Du, 12 oct 14, 10:30:52, The Wanderer wrote:
>> > > On 10/12/2014 at 10:07 AM, Andrei POPESCU wrote:
>> > >
>> > > > Any program t
On Mon, Oct 13, 2014 at 07:53:03AM +0900, Joel Rees wrote:
> 2014/10/13 2:14 "Andrei POPESCU" :
> >
> > On Du, 12 oct 14, 10:30:52, The Wanderer wrote:
> > > On 10/12/2014 at 10:07 AM, Andrei POPESCU wrote:
> > >
> > > > Any program that requires additional scripting just to get it running
> > > >
2014/10/13 2:45 "Steve Litt" :
>
> On Sun, 12 Oct 2014 09:33:43 +0100
> Martin Read wrote:
>
> > On 12/10/14 04:12, Peter Zoeller wrote:
> > > But the nice
> > > thing is shell scripting is simplistic easy to learn and understand.
> >
> > I refer the audience to David A. Wheeler's essay[1] on how
2014/10/13 2:14 "Andrei POPESCU" :
>
> On Du, 12 oct 14, 10:30:52, The Wanderer wrote:
> > On 10/12/2014 at 10:07 AM, Andrei POPESCU wrote:
> >
> > > Any program that requires additional scripting just to get it running
> > > is insufficiently advanced.
> > >
> > > (you can quote me on that)
> >
>
2014/10/12 23:07 "Andrei POPESCU" :
>
> On Sb, 11 oct 14, 21:40:49, Steve Litt wrote:
> >
> > From my viewpoint, shellscripts were never intended to be big, huge
> > programs. To me, they just glue together commands, and have a few
> > rudimentary branching and looping constructs.
>
> Isn't that li
On Sun, 12 Oct 2014 11:16:54 -0700
Don Armstrong wrote:
> On Sun, 12 Oct 2014, Steve Litt wrote:
> > This essay practically screams out for somebody to write a C program
> > that takes an argument of an arbitrary string, finds all files in a
> > directory, and returns a long string with those fil
Don Armstrong writes:
> On Sun, 12 Oct 2014, Steve Litt wrote:
>> This essay practically screams out for somebody to write a C program
>> that takes an argument of an arbitrary string, finds all files in a
>> directory, and returns a long string with those files separated by the
>> arbitrary strin
On Sun, 12 Oct 2014 17:07:01 +0300
Andrei POPESCU wrote:
> On Sb, 11 oct 14, 21:40:49, Steve Litt wrote:
> >
> > From my viewpoint, shellscripts were never intended to be big, huge
> > programs. To me, they just glue together commands, and have a few
> > rudimentary branching and looping constru
Andrei POPESCU wrote:
On Sb, 11 oct 14, 21:40:49, Steve Litt wrote:
From my viewpoint, shellscripts were never intended to be big, huge
programs. To me, they just glue together commands, and have a few
rudimentary branching and looping constructs.
Isn't that like buying IKEA furniture, but whe
On Sun, 12 Oct 2014, Steve Litt wrote:
> This essay practically screams out for somebody to write a C program
> that takes an argument of an arbitrary string, finds all files in a
> directory, and returns a long string with those files separated by the
> arbitrary string.
You seem to be looking fo
On 10/12/2014 at 01:42 PM, Steve Litt wrote:
> On Sun, 12 Oct 2014 09:33:43 +0100 Martin Read
> wrote:
>
>> On 12/10/14 04:12, Peter Zoeller wrote:
>>
>>> But the nice thing is shell scripting is simplistic easy to learn
>>> and understand.
>>
>> I refer the audience to David A. Wheeler's essa
On Sun, 12 Oct 2014 09:33:43 +0100
Martin Read wrote:
> On 12/10/14 04:12, Peter Zoeller wrote:
> > But the nice
> > thing is shell scripting is simplistic easy to learn and understand.
>
> I refer the audience to David A. Wheeler's essay[1] on how to handle
> filenames correctly in shell scrip
On Du, 12 oct 14, 10:30:52, The Wanderer wrote:
> On 10/12/2014 at 10:07 AM, Andrei POPESCU wrote:
>
> > Any program that requires additional scripting just to get it running
> > is insufficiently advanced.
> >
> > (you can quote me on that)
>
> Part of the tradeoff for power is responsibility -
On 10/12/2014 at 10:07 AM, Andrei POPESCU wrote:
> On Sb, 11 oct 14, 21:40:49, Steve Litt wrote:
>
>> From my viewpoint, shellscripts were never intended to be big,
>> huge programs. To me, they just glue together commands, and have a
>> few rudimentary branching and looping constructs.
>
> Isn'
On Sb, 11 oct 14, 21:40:49, Steve Litt wrote:
>
> From my viewpoint, shellscripts were never intended to be big, huge
> programs. To me, they just glue together commands, and have a few
> rudimentary branching and looping constructs.
Isn't that like buying IKEA furniture, but when you get home yo
On 12/10/14 04:12, Peter Zoeller wrote:
But the nice
thing is shell scripting is simplistic easy to learn and understand.
I refer the audience to David A. Wheeler's essay[1] on how to handle
filenames correctly in shell scripts, and to the bug report that he
filed against POSIX.1-2008[2] on t
Hi Steve:
I agree that shell scripts are simplistic and not meant for fancy
programs although it could be done, just not productive. But the nice
thing is shell scripting is simplistic easy to learn and understand.
Sure beats the days when I wrote code in Assembler, Cobol, Fortran, PL1,
RPG,
On Sat, Oct 11, 2014 at 09:40:49PM -0400, Steve Litt wrote:
>
> Now that I've said that, you can accomplish some pretty incredible
> things by gluing a few commands together. I wrote the better half of a
> http log evaluation program using a shellscript gluing together grep,
> cut, and awk, and pi
On Sat, 11 Oct 2014 19:05:19 -0400
Doug wrote:
> On 10/11/2014 05:28 PM, Steve Litt wrote:
> > On Sat, 11 Oct 2014 21:21:14 +0300
> > Daemontools runscripts are incredibly simple shellscripts, that I'm
> > sure you could write no sweat except in very wierd edge cases.
> > Here's my run script fo
34 matches
Mail list logo