11-24-2010
check the return code of mkdir and cp. dont assume it will work correctly
9 More Discussions You Might Find Interesting
1. Linux
I'm sitting here late at night, reading linux from scratch, and I come to this part:
http://lfs.osuosl.org/lfs/view/stable/chapter06/creatingdirs.html
my question to you, the all knowing unix.com'ers is this: what's the difference between using the install command as they do, and using the... (1 Reply)
Discussion started by: thmnetwork
1 Replies
2. Shell Programming and Scripting
Hi,
I look for a script to create 150 directories :
d000
d001
d002
...
...
d149
would you help me please ?
I think it would be
for i
mkdir d$i
Many thanks.
PS :
#uname -a
AIX fserver 3 5 0050691A4C00 (2 Replies)
Discussion started by: big123456
2 Replies
3. UNIX for Advanced & Expert Users
Is there ant way to increase max number of folders in the directory from the 32766:
Problem UFS:
shell>mkdir mmm
mkdir: mmm: Too many links
But there are no links, just folders.
shell>ls | wc -l
32766 (3 Replies)
Discussion started by: mirusnet
3 Replies
4. Shell Programming and Scripting
Hi, please help me with this small script
#!/bin/sh
curdir=`pwd`
n20=$curdir'/n20/'
msat=$curdir'/n20/msat/'
if
then
mkdir $n20
fi
if
then
mkdir $msat
fi
for a in 30 40 50 60 70 80
do (4 Replies)
Discussion started by: Dark2Bright
4 Replies
5. Linux
Hi all, i am new to Linux and need some help.
I used the command: mkdir super
Directory super is created
When i try to change to this directory using: cd /super
I get: bash: cd: /super: No such file or directory
when i use: rm super
I get: rm: cannot remove 'super': Is a directory
What... (5 Replies)
Discussion started by: Deside
5 Replies
6. Homework & Coursework Questions
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!
1. The problem statement, all variables and given/known data:
Do the procedure, which if there are 5 parameters then it creates 4 directories with names of 4 parameters, in... (2 Replies)
Discussion started by: bolones
2 Replies
7. UNIX for Dummies Questions & Answers
Howdy,
Puttering around in unix, and read this in the mkdir man page:
"The mkdir utility creates the directories named as operands..."
What does this mean, i.e. as operands?
Many thanks,
DN (2 Replies)
Discussion started by: danuke
2 Replies
8. UNIX for Dummies Questions & Answers
Hi, I used "mkdir job{0001..10}" do get directories. Now I want to create directories with a variable, for exemple "mkdir job{0001..$a}". When a=5 I get the directory "job{0001..5}". What have i to change to get job0001,...,job0005 :/
Thx for ur help :) (1 Reply)
Discussion started by: E_taks
1 Replies
9. UNIX for Beginners Questions & Answers
hi linux expert
what is a difference between:
mkdir test and mkdir ./test
and also
if ( -e /test ) then and if ( -e ./test ) then
thanks in advance
Please use icode or code tags next time for your code and data (1 Reply)
Discussion started by: abdossamad2003a
1 Replies
LEARN ABOUT MOJAVE
mkpath_np
mkpath_np(3) BSD Library Functions Manual mkpath_np(3)
NAME
mkpath_np -- Auxiliary routine for efficiently creating paths
SYNOPSIS
#include <unistd.h>
int
mkpath_np(const char * path, mode_t omode);
DESCRIPTION
This routine allows the caller to create a path, including intermediate directories. It is equivalent to calling mkdir(1) with the -p com-
mand line argument.
Intermediate directories are created with permission bits of rwxrwxrwx (0777) as modified by the current umask, plus write and search permis-
sion for the owner.
The leaf directory is created with permission bits of omode as modified by the current umask.
RETURN VALUES
A 0 return value indicates success. If an error occurs, the return value is a non-zero error code. Note that EEXIST is returned iff the
leaf directory already exists and is a directory, so under certain circumstances, this error value may not indicate a failure state.
This routine does NOT modify errno.
ERRORS
Any error code that can be returned by mkdir(2) can be returned by mkpath_np(), but mkpath_np() will return the error code rather than set-
ting errno.
[ENOTDIR] A component of the path is not a directory (in contrast to mkdir(2) which returns this based on the path prefix rather
than the path).
[EEXIST] The path already exists and is a directory.
HISTORY
This function first appeared in iOS 5.0.
SEE ALSO
mkdir(1), chmod(2), mkdir(2)
Mac OS X July 13, 2011 Mac OS X