On Mon, Feb 20, 2017 at 10:46:23AM +, Andy Blanchard wrote:
> On 20 February 2017 at 09:18, T_POL wrote:
> >
> > not sure about that but I think the "cd" command executes indeed
> > but it's valid only for the scripts' environment and not for the
> > shell you started the script from.
>
> *di
On 20 February 2017 at 09:18, T_POL wrote:
>
> not sure about that but I think the "cd" command executes indeed
> but it's valid only for the scripts' environment and not for the
> shell you started the script from.
*ding* *ding* *ding* We have a winner!
Shells execute in their own instance of
On Sun, 19 Feb 2017 05:22:44 -0800
Mike Wright wrote:
> Hi all,
>
> My brain cell ran away from home. I have an incredibly simple script
> that doesn't do what I expect. I use "mkdir DIR; cd DIR" a lot so I'm
> trying to put it in a script: "~/bin/mdcd".
>
> After checking that $1 exists:
>
On Sun, Feb 19, 2017 at 02:12:35PM -0800, Joe Zeff wrote:
> On 02/19/2017 05:22 AM, Mike Wright wrote:
> > dir="$1"
> > mkdir -p "$dir"
> > cd "$dir" <-- never executes
> I'm not sure why this doesn't work but you're doing it the hard way.
>
> mkdir -p $1
> cd $1
>
> is much simpler, and
On 02/19/2017 03:46 PM, Patrick O'Callaghan wrote:
On Sun, 2017-02-19 at 05:22 -0800, Mike Wright wrote:
Hi all,
My brain cell ran away from home. I have an incredibly simple script
that doesn't do what I expect. I use "mkdir DIR; cd DIR" a lot so I'm
trying to put it in a script: "~/bin/mdcd
On Sun, 2017-02-19 at 05:22 -0800, Mike Wright wrote:
> Hi all,
>
> My brain cell ran away from home. I have an incredibly simple script
> that doesn't do what I expect. I use "mkdir DIR; cd DIR" a lot so I'm
> trying to put it in a script: "~/bin/mdcd".
>
> After checking that $1 exists:
>
On 02/19/2017 07:22 AM, Mike Wright wrote:
Hi all,
My brain cell ran away from home. I have an incredibly simple script that doesn't do what I
expect. I use "mkdir DIR; cd DIR" a lot so I'm trying to put it in a script:
"~/bin/mdcd".
After checking that $1 exists:
dir="$1"
mkdir -p "$dir"
On 02/19/2017 05:22 AM, Mike Wright wrote:
Hi all,
My brain cell ran away from home. I have an incredibly simple script
that doesn't do what I expect. I use "mkdir DIR; cd DIR" a lot so I'm
trying to put it in a script: "~/bin/mdcd".
After checking that $1 exists:
dir="$1"
mkdir -p "$dir"
cd
Hi all,
My brain cell ran away from home. I have an incredibly simple script
that doesn't do what I expect. I use "mkdir DIR; cd DIR" a lot so I'm
trying to put it in a script: "~/bin/mdcd".
After checking that $1 exists:
dir="$1"
mkdir -p "$dir"
cd "$dir" <-- never executes
The dir
On 17 August 2014 08:36, Cameron Simpson wrote:
> On 16Aug2014 14:44, Mike Wright wrote:
>>
>> I'm trying to write a simple script that if provided an argument, uses
>> that, or if nothing is provided, uses a predefined string.
>
>
> This is general shell stuff, not bash specific.
>
>> if [ -n $#
On 16Aug2014 14:44, Mike Wright wrote:
I'm trying to write a simple script that if provided an argument, uses that, or
if nothing is provided, uses a predefined string.
This is general shell stuff, not bash specific.
if [ -n $# ]
This is always true. Even "0" is a nonempty string.
Test [
08/16/2014 04:14 PM, Mark C. Allman wrote:
On Sun, 2014-08-17 at 00:42 +0200, Suvayu Ali wrote:
On Sat, Aug 16, 2014 at 02:44:14PM -0700, Mike Wright wrote:
Hi all,
I'm trying to write a simple script that if provided an argument, uses that,
or if nothing is provided, uses a predefined string.
On Sun, 2014-08-17 at 00:42 +0200, Suvayu Ali wrote:
> On Sat, Aug 16, 2014 at 02:44:14PM -0700, Mike Wright wrote:
> > Hi all,
> >
> > I'm trying to write a simple script that if provided an argument, uses that,
> > or if nothing is provided, uses a predefined string.
> >
> > if [ -n $# ]
>
> T
On Sat, Aug 16, 2014 at 02:44:14PM -0700, Mike Wright wrote:
> Hi all,
>
> I'm trying to write a simple script that if provided an argument, uses that,
> or if nothing is provided, uses a predefined string.
>
> if [ -n $# ]
This will always be true. -n tests if a string is empty or not. 0
coun
On 08/16/2014 02:44 PM, Mike Wright wrote:
I'm trying to write a simple script that if provided an argument, uses
that, or if nothing is provided, uses a predefined string.
I found this example that might help:
http://tldp.org/LDP/abs/html/comparison-ops.html#STRTEST
--
users mailing list
use
On Sat, Aug 16, 2014 at 02:44:14PM -0700, Mike Wright wrote:
> Hi all,
>
> I'm trying to write a simple script that if provided an argument,
> uses that, or if nothing is provided, uses a predefined string.
>
> if [ -n $# ]
> then
> WORDS=$1
> else
> WORDS="these are some words"
> fi
> ec
On 08/16/2014 02:44 PM, Mike Wright wrote:
if [ -n $# ]
then
WORDS=$1
else
WORDS="these are some words"
fi
echo $WORDS;
The second case is always comes back "".
But if I write
WORDS='these are some words'
echo $WORDS
I get the assigned string.
In your first example, you use full q
Hi all,
I'm trying to write a simple script that if provided an argument, uses
that, or if nothing is provided, uses a predefined string.
if [ -n $# ]
then
WORDS=$1
else
WORDS="these are some words"
fi
echo $WORDS;
The second case is always comes back "".
But if I write
WORDS='these
On 07Jul2013 20:38, Ian Malone wrote:
| On 7 July 2013 20:18, Mike Wright wrote:
| >>> I'm trying to write a bash command to transcode some videos into audios
| >>> but am having trouble with filenames that contain spaces.
| >>>
| >>> ls *flv
| >>>
| >>> returns this:
| >>>
| >>> Jorge Drexler -
Once, long ago--actually, on Sun, Jul 07, 2013 at 02:18:16PM CDT--Mike Wright
(mike.wri...@mailinator.com) said:
> exactly what I needed. I'd never discovered IFS before
As you've discovered, it's quite useful to manipulate IFS. Just a
suggestion, however. In scripts where you modify IFS, do s
On 7-7-13 11:29:05 Mike Wright wrote:
> I'm trying to write a bash command to transcode some videos into audios
> but am having trouble with filenames that contain spaces.
>
> ls *flv
>
> returns this:
>
> Jorge Drexler - Al otro Lado del Río.flv
>
> But in a bash for loop it doesn't work.
>
On 7 July 2013 20:18, Mike Wright wrote:
> 07/07/2013 12:03 PM, Steve Searle wrote:
>>
>> Around 07:29pm on Sunday, July 07, 2013 (UK time), Mike Wright scrawled:
>>
>>> I'm trying to write a bash command to transcode some videos into audios
>>> but am having trouble with filenames that contain sp
07/07/2013 12:03 PM, Steve Searle wrote:
Around 07:29pm on Sunday, July 07, 2013 (UK time), Mike Wright scrawled:
I'm trying to write a bash command to transcode some videos into audios
but am having trouble with filenames that contain spaces.
ls *flv
returns this:
Jorge Drexler - Al otro La
Around 07:29pm on Sunday, July 07, 2013 (UK time), Mike Wright scrawled:
> I'm trying to write a bash command to transcode some videos into audios
> but am having trouble with filenames that contain spaces.
>
> ls *flv
>
> returns this:
>
> Jorge Drexler - Al otro Lado del Río.flv
>
> But in
Hi all,
I'm trying to write a bash command to transcode some videos into audios
but am having trouble with filenames that contain spaces.
ls *flv
returns this:
Jorge Drexler - Al otro Lado del Río.flv
But in a bash for loop it doesn't work.
for f in `ls *flv`; do echo $f; done
returns th
25 matches
Mail list logo