1

i'm creating a small shell script, and i want to know if is there a builtin command to create a new folder without using the mkdir command. I googled it but i wasn't able to find a way to do that.

I dont have any specific motivation or restriction to do that, is more a curiosity about the builtin commands on bash.

I imagine is somenthing like the touch file => > file

Regars

2 Answers2

4

This is not a 'builtins' solution (like touch is not a builtin), but it is a bash friendly solution.

Since this is a script, you imply planning. With this in mind, you create a directory, which you plan to use when the need arises within your script. When you need a new, empty directory, you will use the 'cp -r' command.

You would create a directory: /tmp/seed

In your script you need a directory called blue2013.

cp -r /tmp/seed ./blue123
RobW
  • 2,816
2

We generally don't play games here and artificially restrict what can and can't be used just for the fun of it. The builtin commands are

bash, :, ., [, alias, bg, bind, break, builtin, caller, cd, command, compgen, complete, com- popt, continue, declare, dirs, disown, echo, enable, eval, exec, exit, export, false, fc, fg, getopts, hash, help, history, jobs, kill, let, local, logout, mapfile, popd, printf, pushd, pwd, read, readonly, return, set, shift, shopt, source, suspend, test, times, trap, true, type, typeset, ulimit, umask, unalias, unset, wait

You can find out more about them using man builtins.

user9517
  • 117,122