Re: [OT] bash help

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 might work better.

Unless $1 contains any spaces, in which case the mkdir will create two or
more directories; e.g.:

    $ p="a b"
    $ mkdir $p
    $ ls -l
    total 8
    drwxrwxr-x. 2 davem davem 4096 Feb 20 09:07 a
    drwxrwxr-x. 2 davem davem 4096 Feb 20 09:07 b
    $


-- 
"You may not work around any technical limitations in the software"
    -- Windows Vista license
_______________________________________________
users mailing list -- users@xxxxxxxxxxxxxxxxxxxxxxx
To unsubscribe send an email to users-leave@xxxxxxxxxxxxxxxxxxxxxxx



[Index of Archives]     [Older Fedora Users]     [Fedora Announce]     [Fedora Package Announce]     [EPEL Announce]     [EPEL Devel]     [Fedora Magazine]     [Fedora Summer Coding]     [Fedora Laptop]     [Fedora Cloud]     [Fedora Advisory Board]     [Fedora Education]     [Fedora Security]     [Fedora Scitech]     [Fedora Robotics]     [Fedora Infrastructure]     [Fedora Websites]     [Anaconda Devel]     [Fedora Devel Java]     [Fedora Desktop]     [Fedora Fonts]     [Fedora Marketing]     [Fedora Management Tools]     [Fedora Mentors]     [Fedora Package Review]     [Fedora R Devel]     [Fedora PHP Devel]     [Kickstart]     [Fedora Music]     [Fedora Packaging]     [Fedora SELinux]     [Fedora Legal]     [Fedora Kernel]     [Fedora OCaml]     [Coolkey]     [Virtualization Tools]     [ET Management Tools]     [Yum Users]     [Yosemite News]     [Gnome Users]     [KDE Users]     [Fedora Art]     [Fedora Docs]     [Fedora Sparc]     [Libvirt Users]     [Fedora ARM]

  Powered by Linux