Sponsored Content
Top Forums UNIX for Advanced & Expert Users Substitute single backward-slash with the double backward-slash Post 302329102 by mvictorvijayan on Friday 26th of June 2009 12:34:01 AM
Old 06-26-2009
Thanks methyl, it works fine.
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Find the current cursor word in backward

hello, i'm using the vi editor (not vim) and my main use in it is for C++ programming. After working on Visual Studio 2005 the auto-complete looks like paradise now... so i'm trying to find a way to have auto-complete also in the vi. i cant install vim and use the ctrl+P. i need to find a way... (1 Reply)
Discussion started by: Malbinir
1 Replies

2. Shell Programming and Scripting

forward/backward capable prompt

Hi, I would like to construct an interactive prompt for a series of bash shell scripts. This prompt will ask the user a series of questions, and the answers will determine which scripts are run, and in which order. I am familiar with the "read" command, and have successfully constructed a... (2 Replies)
Discussion started by: msb65
2 Replies

3. 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

4. SCO

sco unix backward compatibility on "max open file per process"

Hi How to increase maximum number of open file in "sco xenix binary" running in "sco unix openserver 5.0.7" ? I have changed "NOFILES" kernel parameter to 512, but xenix binray can't open more than 60. tnx (4 Replies)
Discussion started by: javad1_maroofi
4 Replies

5. Shell Programming and Scripting

backward string cut

I need only the last .ko files to be stripped from the whole result., ie libiscsi2.ko, scsi_transport_iscsi2.ko etc.. kernel/drivers/scsi/libiscsi2.ko kernel/drivers/scsi/scsi_transport_iscsi2.ko kernel/drivers/scsi/scsi_transport_iscsi.ko kernel/fs/nls/nls_utf8.ko... (4 Replies)
Discussion started by: anilcliff
4 Replies

6. UNIX for Dummies Questions & Answers

Help With Backward grep

hey, i got 2 files with the following content: file1: LOCAL_GSK1 50:01:24:80:45:f1:15:23 50:01:24:81:45:f1:15:23 50:01:24:82:45:f1:15:23 50:01:24:83:45:f1:15:23 LOCAL_GSK2 50:01:24:82:00:9c:d7:a7 50:01:24:82:01:bc:d7:a7 50:01:24:82:02:dc:d7:a7 50:01:24:82:03:fc:d7:a7 LOCAL_GSK3... (1 Reply)
Discussion started by: boaz733
1 Replies

7. Programming

Backward compatibility in python

Actually I have installed python 3.2. It seems there are a lot of synta variance between 2.2 and 3.2. Is it possible to run a script in 2.2 without actually installing 2.2. But I have installed 3.2. and also is it possible to access the 2.2 shell in 3.2 version. I am naive in python . Please... (1 Reply)
Discussion started by: pandeesh
1 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. Shell Programming and Scripting

Backward compatibility issue with GNU bash, version 4.3.42(5)

Hi, I have made a snake game on below bash version. But it is not backward compatible. Can someone suggest a version which is most commonly used and is backward compatible so that i can change my code and share again? I have attached the game script. If someone can run it please also suggest... (5 Replies)
Discussion started by: amit14august
5 Replies
basename(3)						     Library Functions Manual						       basename(3)

NAME
basename, dirname, dirname_r - Return the base filename or directory portion of a pathname LIBRARY
Standard C Library (libc) SYNOPSIS
#include <libgen.h> char *basename( char *path); char *dirname( char *path); The following function is supported only for backward compatibility: #include <string.h> int dirname_r( char *path, char *buf, int size); STANDARDS
Interfaces documented on this reference page conform to industry standards as follows: basename(), dirname(): XSH4.2 Refer to the standards(5) reference page for more information about industry standards and associated tags. PARAMETERS
The string from which the base pathname or the directory portion is to be extracted. [Tru64 UNIX] Specifies a working buffer to hold the directory name component. [Tru64 UNIX] Specifies the length of buf. DESCRIPTION
The basename() and dirname() functions complement each other. The basename() function reads path and returns a pointer to the final compo- nent of the pathname, deleting any trailing / (slash) characters. If the string consists entirely of the / (slash) character, basename() returns a pointer to the string / (slash). If path is a null pointer or points to an empty string, basename() returns a pointer to the string . (period). [Tru64 UNIX] In applications that are compiled in an environment that excludes the _XOPEN_SOURCE_EXTENDED standard definitions, the base- name() function returns an empty string if the string consists entirely of the / (slash) character. If path is a null pointer, basename() returns a core dump. If path points to an empty string, basename() returns an empty string. The dirname() function reads path and returns a pointer to a new string that is a pathname of the parent directory of that file. Trailing / (slash) characters in the path are not counted as part of the path. If there is no / (slash), if path is a null pointer, or if path points to an empty string, the dirname() function returns a pointer to the string . (period). [Tru64 UNIX] In applications that are compiled in an environment that excludes the _XOPEN_SOURCE_EXTENDED standard definitions, the dirname() function returns a NULL if there is no / (slash), and a core dump if path is a null pointer, or if path points to an empty string. The dirname_r() function is the reentrant version of the dirname() function. It is supported only to maintain backward compatibility with versions of the operating system prior to DIGITAL UNIX Version 4.0. NOTES
The value returned by the basename() and dirname() functions is a pointer to a thread-specific buffer whose contents will be overwritten on subsequent calls from the same thread. [Tru64 UNIX] The basename(), dirname(), and dirname_r() functions belong to a small set of libc functions that are handled differently when compiled in the X/Open UNIX environment. In the X/Open UNIX environment, calls to these functions are internally renamed by prepend- ing _E to the function name. The renaming is done only when there is an incompatible conflict between an existing version of the function and the version that conforms to the X/Open UNIX standard. The renaming strategy supports binary compatibility by allowing applications to compile in the X/Open UNIX environment and also link with site-specific and third-party libraries that use the old versions of the same libc interfaces. However, internal renaming of the calls affects how these calls are identified during debugging sessions. Therefore, when you are debugging a module that includes the basename() and/or dirname() or dirname_r() functions and for which _XOPEN_SOURCE_EXTENDED has been defined, use _Ebasename to refer to the basename() call and _Edirname to refer to the dirname call and _Edirname_r to refer to the dirname_r call. See standards(5) for information on when the _XOPEN_SOURCE_EXTENDED macro is defined. RETURN VALUES
Upon success, the basename() and dirname() functions return the component string. Upon failure, these functions return NULL. If there is no / (slash), the dirname() function returns a . (period). [Tru64 UNIX] In applications that are compiled in an environment that excludes the _XOPEN_SOURCE_EXTENDED standard definitions, the dirname() function returns NULL if there is no / (slash). [Tru64 UNIX] Upon successful completion, the dirname_r() function returns a value of 0 (zero) and places the directory name component in the buffer pointed at by buf. Upon failure (for example, if there is no / (slash)), the dirname_r() function returns -1 and sets errno. ERRORS
If the dirname_r() function fails, errno may be set to the following: The value of the buf parameter is invalid or too small. RELATED INFORMATION
Commands: basename(1) Standards: standards(5) delim off basename(3)
All times are GMT -4. The time now is 02:35 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy