Adding "helllllllllllllp!!!!11/1/1./1one" to a post never helps. Don't do it.
Since you're using mkdir -p, you don't need to check if a directory already exists. It will work fine if it does already, and return error if it can't make any of the directories. Much less repetition.
I am trying to create a menu, and the script fails on ln 38 (Files in pwd). Any idea on where the problem is??
Thanks for the help
Rob
#!/bin/bash
# Cool Script for Weekly Assignment 2 (#3) that creates a menu to act as a ui
# and run some popular commands.
clear
while :
do ... (9 Replies)
I can do this on the command line:
sqsh -S 192.168.x.x -o tmp -U user -P fakepass -D horizon -C "\
select second_id
from borrower
where btype like '%wsd%'
"
I can also just leave the SQL at the end intact on one line ....
... However, when I throw this in a script like:
$SQSH -o... (4 Replies)
Hi,
I am a complete Unix novice and need some help with creating a login shell script. I have created a file with user details i.e. PIN, name etc and require help in recalling the specified details from the file and being prompted for a password on login. Any help would be very much appreciated.... (0 Replies)
Hi All,
Linux lxs3er06 2.6.9-67.ELsmp #1 SMP Wed Nov 7 13:58:04 EST 2007 i686 i686 i386 GNU/Linux
Issue:
While executing shell scripts in bash shell, following error messages are thrown:
rm:command not found
On doing little investigation, I added '/bin' to $PATH and on doing echo... (9 Replies)
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:
Hi I am new to unix and need some help, the main reason I am here is because i need basic unix knowledge
The... (2 Replies)
PLEASE HELP!
NEED LINUX SCTIPT
Need to write a bash shell script to show information of employees of a department from a company data set.
The script should accept a project number (1/2/3/10/20/30) and output
* the name of the project
* the name of the manager of the controlling... (1 Reply)
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:
Write a bash shell script that presents work information of employees of a department from a company data... (1 Reply)
Hello Friends
I am having trouble with my script below. I will describe the problems below the code box. I am hoping that some of the experts here can help me.
#!/bin/bash
#=========================================================================================================
# Rsync File... (8 Replies)
Hi,
maybe I'm asking a VERY dumb question, but would anybody out there tell me, why this f****** script won't work if executed as a cronjob, but works fine if executed from a shell prompt?
#! /bin/bash
set PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
date >>... (3 Replies)
Migrating Unix batch jobs (Korn Shell) running in HP-UX server to Linux environment.
Hi All
Please help me to understand the easiest way to migrate Kernel Shell scripts to Linux Bash. Also let me know
1. Any automated scripts or tools available for this.
2. Challenges and issues... (5 Replies)
Discussion started by: cpremesh
5 Replies
LEARN ABOUT SUNOS
mkdirp
mkdirp(3GEN) String Pattern-Matching Library Functions mkdirp(3GEN)NAME
mkdirp, rmdirp - create or remove directories in a path
SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ]
#include <libgen.h>
int mkdirp(const char *path, mode_t mode);
int rmdirp(char *dir, char *dir1);
DESCRIPTION
The mkdirp() function creates all the missing directories in path with mode. See chmod(2) for the values of mode.
The rmdirp() function removes directories in path dir. This removal begins at the end of the path and moves backward toward the root as far
as possible. If an error occurs, the remaining path is stored in dir1.
RETURN VALUES
If path already exists or if a needed directory cannot be created, mkdirp() returns -1 and sets errno to one of the error values listed for
mkdir(2). It returns zero if all the directories are created.
The rmdirp() function returns 0 if it is able to remove every directory in the path. It returns -2 if a ``.'' or ``..'' is in the path and
-3 if an attempt is made to remove the current directory. Otherwise it returns -1.
EXAMPLES
Example 1: Example of creating scratch directories.
The following example creates scratch directories.
/* create scratch directories */
if(mkdirp("/tmp/sub1/sub2/sub3", 0755) == -1) {
fprintf(stderr, "cannot create directory");
exit(1);
}
chdir("/tmp/sub1/sub2/sub3");
.
.
.
/* cleanup */
chdir("/tmp");
rmdirp("sub1/sub2/sub3");
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|MT-Level |MT-Safe |
+-----------------------------+-----------------------------+
SEE ALSO chmod(2), mkdir(2), rmdir(2), malloc(3C), attributes(5)NOTES
The mkdirp() function uses malloc(3C) to allocate temporary space for the string.
SunOS 5.10 14 Oct 2003 mkdirp(3GEN)