Sponsored Content
Full Discussion: wildcards in path
Top Forums UNIX for Dummies Questions & Answers wildcards in path Post 302354283 by Corona688 on Thursday 17th of September 2009 04:24:24 PM
Old 09-17-2009
As I explained, shell globbing can't find things that don't exist yet.
Code:
$ mkdir a b c d
# a/q, b/q, c/q, d/q don't exist yet, so globbing won't work
$ touch [abcd]/q
touch: cannot touch `[abcd]/q':  No such file or directory
$ touch a/q b/q c/d q/q
# Since these files already exist, it will find them
$ touch [abcd]/q
$

But, as I also explained, globbing can find a directory. It can find ~/Library/Application/*.default, just not ~/Library/Application/*.default/file-I-want-to-create-but-does-not-yet-exist.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Wildcards in VI

I'm trying to delete lines from a large text file using VI. Every line that I am wanting to delete start with 'S' - all others do not. (A list of users) I've tried using * but doesn't seem to like it...any ideas... Doesn't have to be VI - but I'm better with VI than sed/awk. (8 Replies)
Discussion started by: peter.herlihy
8 Replies

2. UNIX for Dummies Questions & Answers

wildcards

when writing a shell script (bourne) and using a unix command like 'ls' is there anything special you need to do to use a wildcard (like *)? (3 Replies)
Discussion started by: benu302000
3 Replies

3. UNIX for Dummies Questions & Answers

ls with wildcards

ok, I'm trying to write a script file that lists files with specific elements in the name into a txt file, it looks like this ls s*.dat > file_names.txt can't figure out whats wrong with that line, any ideas? thanks in advance (10 Replies)
Discussion started by: benu302000
10 Replies

4. UNIX for Dummies Questions & Answers

wildcards NOT

Hi All Please excuse another straightforward question. When creating a tar archive from a directory I am attempting to use wildcards to eliminate certain filetypes (otherwise the archive gets too large). So I am looking for something along these lines. tar -cf archive.tar * <minus all *.rst... (5 Replies)
Discussion started by: C3000
5 Replies

5. Shell Programming and Scripting

Executing Commands From Non-Standard Path (Changing user's PATH secretely???)

Hi: I have a requirement as below: I have some standard Unix commands modified and kept them in a directory say /usr/clsh/bin. For example I have a script named "ls" kept here which is modified version of "ls" (say it always gives long listing i.e. ls -l). When any user logs on and types... (2 Replies)
Discussion started by: ramesh_samane
2 Replies

6. UNIX for Advanced & Expert Users

Wildcards

These 2 websites do a GREAT job of explaining different types of wildcards. I learned about the categories of characters which I never knew about at all. GNU/Linux Command-Line Tools Guide - Wildcards GREP (1 Reply)
Discussion started by: cokedude
1 Replies

7. Shell Programming and Scripting

Moving files from parent path to multiple child path using bash in efficient way

Hi All, Can you please provide some pointers to move files from Base path to multiple paths in efficient way.Folder Structure is already created. /Path/AdminUser/User1/1111/Reports/aaa.txt to /Path/User1/1111/Reports/aaa.txt /Path/AdminUser/User1/2222/Reports/bbb.txt to... (6 Replies)
Discussion started by: karthikgv417
6 Replies

8. Shell Programming and Scripting

Generate class path dynamically based on source path

Hi experts, I have multiple file names ending with .jsp located in $SOME_DIR, $SOME_DIR/f1/,$SOME_DIR/f2/test,$SOME_DIR/f3/fa and there are equivalent class files in $SOME_DIR/WEB-INF/classes/_pages,$SOME_DIR/WEB-INF/classes/_pages/_f1,... (0 Replies)
Discussion started by: oraclermanpt
0 Replies

9. UNIX for Advanced & Expert Users

Command to see the logical volume path, device mapper path and its corresponding dm device path

Currently I am using this laborious command lvdisplay | awk '/LV Path/ {p=$3} /LV Name/ {n=$3} /VG Name/ {v=$3} /Block device/ {d=$3; sub(".*:", "/dev/dm-", d); printf "%s\t%s\t%s\n", p, "/dev/mapper/"v"-"n, d}' Would like to know if there is any shorter method to get this mapping of... (2 Replies)
Discussion started by: royalibrahim
2 Replies

10. UNIX for Beginners Questions & Answers

Convert Relative path to Absolute path, without changing directory to the file location.

Hello, I am creating a file with all the source folders included in my git branch, when i grep for the used source, i found source included as relative path instead of absolute path, how can convert relative path to absolute path without changing directory to that folder and using readlink -f ? ... (4 Replies)
Discussion started by: Sekhar419
4 Replies
mkdirp(3G)																mkdirp(3G)

NAME
mkdirp(), rmdirp() - create, remove directories in a path SYNOPSIS
DESCRIPTION
creates all the missing directories in the given path with the given mode (see chmod(2) for the values of mode.) The protection part of the mode argument is modified by the process's file creation mask (see umask(2)). rmdirp removes directories in path d. This removal starts at the end of the path and moves back toward the root as far as possible. If an error occurs, the remaining path is stored in d1. returns a 0 only if it is able to remove every directory in the path. To use these interfaces, link in the libgen library by specifying For example: RETURN VALUE
If a needed directory cannot be created, returns -1 and sets to one of the error numbers. If all the directories are created, or existed to begin with, it returns zero. EXAMPLES
WARNINGS
uses to allocate temporary space for the string. returns if a "" or "" is in the path. It returns if an attempt is made to remove the current directory. If an error occurs other than one of these two errors, returns SEE ALSO
chmod(2), mkdir(2), rmdir(2), umask(2), thread_safety(5). mkdirp(3G)
All times are GMT -4. The time now is 03:01 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy