Sponsored Content
Top Forums Programming touching a file which contains slash char Post 302090335 by Perderabo on Monday 25th of September 2006 05:54:49 AM
Old 09-25-2006
If you mean that you want the file name to contain a slash, you are out of luck. The system calls all will intrepret a slash to indicate a directory name. So if you try to create, say, "a/b", the kernel will expect a directory called "a" to be present and will try to create a file called "b" in it.
 

9 More Discussions You Might Find Interesting

1. UNIX for Advanced & Expert Users

Substitute single backward-slash with the double backward-slash

Hi, I have a path like this c:\test\sample\programs, i need to change thiis to c:\\test\\sample\\programs. How to perform this? I tried tr command but it didn't help me. Thanks Vijayan (3 Replies)
Discussion started by: mvictorvijayan
3 Replies

2. Shell Programming and Scripting

Using sed to append backward slash before forward slash

Hi all, I need to know way of inserting backward slash before forward slash. My problem is that i need to supply directory path as an argument while invoking cshell script. This argument is further used in script (i.e. sed is used to insert this path in some file). So i need to place \ in front... (2 Replies)
Discussion started by: sarbjit
2 Replies

3. Shell Programming and Scripting

How to replace comma by slash using sed in an UTF8 file

Hello all, I'd like to replace "," by "/" in a utf8 file from postion X to Y. Comma "," is also defined as delimiter. 12345678901234567890,123456789012345,12345678901234567890, aaaa,aaaa,aaaaa ,bbb,bbbb,bbbbb ,cccccc,cc , Result should be... (1 Reply)
Discussion started by: fmofmo
1 Replies

4. Shell Programming and Scripting

stdout to file or character device with trailing slash

I have an interesting one for the gurus out there that may have an idea as to why this is happening. We're currently migrating from Solaris 9 to Solaris 10 and we've run into a very strange issue. There are a bunch of shell scripts people have written throughout a directory that are used for... (4 Replies)
Discussion started by: dcarrion87
4 Replies

5. UNIX for Dummies Questions & Answers

Touching files?

So, I think this is a really stupid question, but I'd like to see if I am right. If the following commands are entered: umask 000 touch file1 umask111 touch file2 ...nothing should happen...right? The touch operation isn't going to apply any changes from umask to file1 (and same to... (1 Reply)
Discussion started by: Midwest Product
1 Replies

6. Shell Programming and Scripting

rouch acts strange after touching around

hi there Strange title? Well yes...it is strange..."touch" is driving me nutts! Trying to set the access / modified date by a bash script. For a certain time everything works well with all files. After point x the code works only for some files, for others it doesn't. After looking for the ... (4 Replies)
Discussion started by: blah0
4 Replies

7. Shell Programming and Scripting

remove commas if touching any letters

I have a csv file that I am trying to edit. I need to remove any comma that is touching a letter. I used this command to find them. grep , moz_places_good.csv | head -n 10 | grep ,I would think I could use some form of this to just delete the commas and not the letter before it. Just not sure... (5 Replies)
Discussion started by: cokedude
5 Replies

8. Shell Programming and Scripting

Double slash into a file

I need to add double slash into a file using "echo" command. I tried the below from the command line and it worked. echo "\\\\abcd\efgh" > file more file \\abcd\efgh but if i use the same command within a script its showing only 1 slash Pls help (2 Replies)
Discussion started by: gpk_newbie
2 Replies

9. UNIX for Dummies Questions & Answers

Inspecting leading char in string for slash

In a SCO Unix shop, I am working on the following script to move any file to its same location on the target machine (called 'othersy' here): pwd=`pwd` for i in "$@" do echo " $i " if ; then echo 1; else echo 0; fi rcp -p $i othersy:$pwd/$i echo "Finished with ^ If I find a file... (4 Replies)
Discussion started by: wbport
4 Replies
pathfind(3GEN)					     String Pattern-Matching Library Functions					    pathfind(3GEN)

NAME
pathfind - search for named file in named directories SYNOPSIS
cc [ flag ... ] file ... -lgen [ library ... ] #include <libgen.h> char *pathfind(const char *path, const char *name, const char *mode); DESCRIPTION
The pathfind() function searches the directories named in path for the file name. The directories named in path are separated by colons (:). The mode argument is a string of option letters chosen from the set [rwxfbcdpugks]: +-----------------------------+-----------------------------+ | Letter | Meaning | +-----------------------------+-----------------------------+ |r |readable | +-----------------------------+-----------------------------+ |w |writable | +-----------------------------+-----------------------------+ |x |executable | +-----------------------------+-----------------------------+ |f |normal file | +-----------------------------+-----------------------------+ |b |block special | +-----------------------------+-----------------------------+ |c |character special | +-----------------------------+-----------------------------+ |d |directory | +-----------------------------+-----------------------------+ |p |FIFO (pipe) | +-----------------------------+-----------------------------+ |u |set user ID bit | +-----------------------------+-----------------------------+ |g |set group ID bit | +-----------------------------+-----------------------------+ |k |sticky bit | +-----------------------------+-----------------------------+ |s |size non-zero | +-----------------------------+-----------------------------+ Options read, write, and execute are checked relative to the real (not the effective) user ID and group ID of the current process. If name begins with a slash, it is treated as an absolute path name, and path is ignored. An empty path member is treated as the current directory. A slash (/) character is not prepended at the occurrence of the first match; rather, the unadorned name is returned. EXAMPLES
Example 1 Example of finding the ls command using the PATH environment variable. To find the ls command using the PATH environment variable: pathfind (getenv ("PATH"), "ls", "rx") RETURN VALUES
The pathfind() function returns a (char *) value containing static, thread-specific data that will be overwritten upon the next call from the same thread. If the file name with all characteristics specified by mode is found in any of the directories specified by path, then pathfind() returns a pointer to a string containing the member of path, followed by a slash character (/), followed by name. If no match is found, pathname() returns a null pointer, ((char *) 0). ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |MT-Level |MT-Safe | +-----------------------------+-----------------------------+ SEE ALSO
sh(1), test(1), access(2), mknod(2), stat(2), getenv(3C), attributes(5) NOTES
The string pointed to by the returned pointer is stored in an area that is reused on subsequent calls to pathfind(). The string should not be deallocated by the caller. When compiling multithreaded applications, the _REENTRANT flag must be defined on the compile line. This flag should only be used in mul- tithreadedapplications. SunOS 5.11 10 Mar 1999 pathfind(3GEN)
All times are GMT -4. The time now is 02:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy