Equivalent of Substr in Unix


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Equivalent of Substr in Unix
# 8  
Old 12-11-2007
Hi, porter.
Quote:
Originally Posted by porter
What I would do is

(a) pipe it through sed to change the : to a space

Code:
VAR=123456:abcdeg
VAR2=`echo $VAR | sed y/:/\ /`

(b) use a function to get the first part

Code:
first()
{
   return $1
}

VAR3=`first $VAR2`

You probably wrote "return $1" in the function, meaning rather to write "echo $1" ... cheers, drl
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need Linux equivalent for UNIX

I have a folder called "log" which has a few sub-folders say "fda" "fd7" "fdd" "fd6 .... " I wish to fire the below command inside each subfolder starting with the folder with the latest time stamp. grep "$greptime.*exit" Prod.$(hostname).log | grep $fdrdate_new If the seach did not yield... (3 Replies)
Discussion started by: mohtashims
3 Replies

2. HP-UX

UNIX VI editor equivalent of LINUX

Hi All, I am comfortable working in LINUX and need equivalents for HP-UX for below mentioned, 1. We use TAB key to expand/reveal a name in LINUX. Is there any way to make this work for UNIX, where it is double escape. 2. Also can we use make use of left,down,up,right keys instead... (3 Replies)
Discussion started by: pradebban
3 Replies

3. UNIX for Dummies Questions & Answers

Locate equivalent in UNIX

Hi All, I am a frequent user of loacate in linux and really impressed with its speed and accuracy. I would like to know if there is any such equivalent in UNIX. (not the find, which is relatively very slow) Any locate packages which can be made available in UNIX(HP-UX) for this? TIA,... (4 Replies)
Discussion started by: pradebban
4 Replies

4. UNIX for Dummies Questions & Answers

Unix equivalent of DOS set

Hi all, what is the equivalent command of the DOS set that lists all the environment variable and their values? Xavier. (3 Replies)
Discussion started by: xxavier
3 Replies

5. UNIX for Advanced & Expert Users

Equivalent command for setlocal in Unix

Hi all, Is there any command in unix equivalent to setlocal in windows. setlocal command is really useful in restoring local environment variables in windows. Thanks, Sonal. (7 Replies)
Discussion started by: sonaluphale
7 Replies

6. UNIX for Advanced & Expert Users

ufsdump equivalent in linux and unix

Hi all, I am preparing for a worst case scenario. Say i have a production server A, should A fails ( for whatever reason), i want another server B to take over. How can i move everything from A to B? Assuming i have regular backup of A. I've searched in the forums, and briefly came across... (4 Replies)
Discussion started by: new2ss
4 Replies

7. Programming

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (2 Replies)
Discussion started by: anjan_kumar_k
2 Replies

8. UNIX for Advanced & Expert Users

IsDBCSLeadByteEx equivalent for unix

I am using IsDBCSLeadByteEx for windows, i would like to know whether there is any equivalent function in unix(linux) platform. (1 Reply)
Discussion started by: anjan_kumar_k
1 Replies

9. UNIX for Advanced & Expert Users

batch file equivalent for Unix

i was trying to do a simple batch file equivalent in Unix when i write a single command in a file, give executable permissions and run it (i gave the file name as a command at the prompt), it works fine. but when i have more than 1 command, say my file has a.out ls ls a.out it doesnt... (1 Reply)
Discussion started by: megastar
1 Replies

10. Programming

unix equivalent for windows APIs..........................

Hi, Is there any unix equivalents available for the folllowing windows function ? FindFirstFile FindNextFile etc..... Or do i have to write an equivalent api?? Can anybody help me to do the same?? thanks in advance Ani (2 Replies)
Discussion started by: ani
2 Replies
Login or Register to Ask a Question
GENISOIMAGERC(5)                                                File Formats Manual                                               GENISOIMAGERC(5)

NAME
genisoimagerc - startup configuration file for genisoimage DESCRIPTION
genisoimage(1) searches for a configuration file in several places; it uses the first one it is able to open. First, if the GENISOIMAGERC environment variable is set, its value is used as the filename; likewise for the MKISOFSRC environment variable. Next, genisoimage looks for files named .genisoimagerc or .mkisofsrc, first in the current working directory, then in the user's home directory. Next, it looks for /etc/genisoimagerc. Finally, it looks for a .genisoimagerc in the same directory as genisoimage itself is stored. The .genisoimagerc file contains lines of the form TAG=value where TAG is one of the settings defined below. The case of the tag is not significant. All settings have command-line equivalents; if the command-line parameter is specified, it takes priority over the configuration file. Blank lines and lines beginning with `#' are ignored. CONFIGURATION SETTINGS
ABST The abstract information, typically the name of a file on the disc containing an abstract. There is space for 37 characters. Equivalent to the -abstract command-line option. APPI The application identifier should describe the application that will be on the disc. There is space for 128 characters. Equivalent to the -A command-line option. BIBL The bibliographic information, often the name of a file on the disc containing a bibliography. There is space for 37 characters. Equivalent to the -biblio command-line option. COPY The copyright information, typically the name of a file on the disc containing the copyright notice. There is space for 37 charac- ters. Equivalent to the -copyright command-line option. HFS_TYPE The default TYPE for Macintosh files. Must be exactly 4 characters. Equivalent to the -hfs-type command-line option. The default value is TEXT. HFS_CREATOR The default CREATOR for Macintosh files. Must be exactly 4 characters. Equivalent to the -hfs-creator command-line option. The default value is Unix. PREP This should describe the preparer of the CD-ROM, usually with a mailing address and phone number. There is space for 128 charac- ters. Equivalent to the -p command-line option. PUBL This should describe the publisher of the CD-ROM, usually with a mailing address and phone number. There is space for 128 charac- ters. Equivalent to the -publisher command-line option. SYSI The System Identifier. There is space for 32 characters. Equivalent to the -sysid command-line option. VOLI The Volume Identifier. There is space for 32 characters. Equivalent to the -V command-line option. VOLS The Volume Set Name. There is space for 128 characters. Equivalent to the -volset command-line option. genisoimage can also be configured at compile time with defaults for many of these fields. See the file defaults.h. EXAMPLES
The following file COPY=src/COPYING SYSI=Multics 75 is equivalent to the genisoimage command-line parameters -copyright src/COPYING -sysid "Multics 75" SEE ALSO
genisoimage(1). AUTHORS
See the genisoimage(1) manual page for credits for the genisoimage program and documentation. 13 Dec 2006 GENISOIMAGERC(5)