Sponsored Content
Top Forums Shell Programming and Scripting Extracting Details from string -- Help Me!!! Post 302910388 by chacko193 on Thursday 24th of July 2014 04:48:29 AM
Old 07-24-2014
Try:
Code:
[ -f ${FilePath#$HOST_NAME_LAND} ] && echo "File Exists"

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Extracting String from a list

I have a string of Data such as Date Time Tran1 Tran2 Tran3 ...... How can I extract just all the trans excluding Date and Time. Thanks, Odogbolu98 ;) (4 Replies)
Discussion started by: odogbolu98
4 Replies

2. Shell Programming and Scripting

extracting from a string

How do I extract 5th to 10th characters of string as given below stored in a shell variable. "ab cd ef gh ij kl" How is cut to be used on this? Thanks for any help. (1 Reply)
Discussion started by: preetikate
1 Replies

3. Shell Programming and Scripting

Extracting a string from one file and searching the same string in other files

Hi, Need to extract a string from one file and search the same in other files. Ex: I have file1 of hundred lines with no delimiters not even space. I have 3 more files. I should get 1 to 10 characters say substring from each line of file1 and search that string in rest of the files and get... (1 Reply)
Discussion started by: mohancrr
1 Replies

4. Shell Programming and Scripting

extracting a string

Hi All, I am writing a shell script for which I am stuck with an extraction part. I arrived till extraction of a path of file. Lets take an example. I now have a file which contains following one line: 2348/home/userid/mydir/any_num_dir/myfile.text Now I want to extract only... (2 Replies)
Discussion started by: start_shell
2 Replies

5. Shell Programming and Scripting

Extracting String

I am trying to extract a hyperlink from a html document using awk. I have managed to output in the format... href="index.html"> where i would like it just to output index.html. Any ideas on how i would do this? Thanks (2 Replies)
Discussion started by: adpe
2 Replies

6. Shell Programming and Scripting

Extracting Date from string

Hi Gurus I want to extract a date and version code which shall come in filename consisting of underscores. The filename can contain any / one underscores but the version number will come after date and will be separted by underscore String formats ============= ABC_20090815_2.csv... (13 Replies)
Discussion started by: r_t_1601
13 Replies

7. Shell Programming and Scripting

Extracting particular string in a file and storing matched string in output file

Hi , I have input file and i want to extract below strings <msisdn xmlns="">0492001956</ msisdn> => numaber inside brackets <resCode>3000</resCode> => 3000 needs to be extracted <resMessage>Request time getBalances_PSM.c(37): d out</resMessage></ns2:getBalancesResponse> => the word... (14 Replies)
Discussion started by: sushmab82
14 Replies

8. UNIX for Dummies Questions & Answers

Extracting numbers from a String

Hi all, I'm a new programmer to shell script... and I have no idea how to use substring. I want to extract the numbers from the following string and place it into a variable: "170 unique conformations found" The numbers can be more than three digits depending on the case. I just want to... (10 Replies)
Discussion started by: ah7391
10 Replies

9. UNIX for Dummies Questions & Answers

at -l doesnt give details of the scheduled job. How to get the details?

I have scheduled couple of shell scripts to run using 'at' command. The o/p of at -l is: $ at -l 1320904800.a Thu Nov 10 01:00:00 2011 1320894000.a Wed Nov 9 22:00:00 2011 1320876000.a Wed Nov 9 17:00:00 2011 $ uname -a SunOS dc2prcrptetl2 5.9 Generic_122300-54 sun4u sparc... (2 Replies)
Discussion started by: superparticle
2 Replies

10. Shell Programming and Scripting

Extracting substring within string between 2 token within the string

Hello. First best wishes for everybody. here is the input file ("$INPUT1") contents : BASH_FUNC_message_begin_script%%=() { local -a L_ARRAY; BASH_FUNC_message_debug%%=() { local -a L_ARRAY; BASH_FUNC_message_end_script%%=() { local -a L_ARRAY; BASH_FUNC_message_error%%=() { local... (3 Replies)
Discussion started by: jcdole
3 Replies
zipios::FilePath(3)					     Library Functions Manual					       zipios::FilePath(3)

NAME
zipios::FilePath - FilePath represents a path to a file or directory name. SYNOPSIS
#include <filepath.h> Public Member Functions FilePath (const string &path='', bool check_exists=false) Constructor. FilePath & operator= (const string &rhs) operator string () const FilePath operator+ (const FilePath &name) const Concatenates FilePath objects. FilePath filename () const Returns filename of the FilePath object by pruning the path off. bool exists () const bool isRegular () const bool isDirectory () const bool isCharSpecial () const bool isBlockSpecial () const bool isSocket () const bool isFifo () const Protected Member Functions void pruneTrailingSeparator () Prunes the trailing separator of a specified path. void check () const This function sets _checked to true, stats the path, to see if it exists and to determine what type of file it is. Protected Attributes bool _checked bool _exists bool _is_reg bool _is_dir bool _is_char bool _is_block bool _is_socket bool _is_fifo string _path Static Protected Attributes static const char _separator = '/' Detailed Description FilePath represents a path to a file or directory name. FilePath has member functions to check if the file path is a valid file system entity, and to check what kind of file system entity it is, e.g. is it a file, a directory, a pipe etc. Definition at line 18 of file filepath.h. Constructor &; Destructor Documentation zipios::FilePath::FilePath (const string &path = '', boolcheck_exists = false) Constructor. Parameters: path A string representation of the path. check_exists If true is specified the constructor will check the existence and type of the path immidiately, instead of deferring that task until it is needed. Definition at line 18 of file filepath.cpp. Member Function Documentation void zipios::FilePath::check () const [protected] This function sets _checked to true, stats the path, to see if it exists and to determine what type of file it is. All the query functions check if _checked is true, and if it isn't they call check(). This means stat'ing is deferred until it becomes necessary. Definition at line 27 of file filepath.cpp. bool zipios::FilePath::exists () const [inline] Returns: true If the path is a valid file system entity. Definition at line 129 of file filepath.h. FilePath zipios::FilePath::filename () const [inline] Returns filename of the FilePath object by pruning the path off. Definition at line 119 of file filepath.h. bool zipios::FilePath::isBlockSpecial () const [inline] Returns: true if the path is block special (a block device file). Definition at line 157 of file filepath.h. bool zipios::FilePath::isCharSpecial () const [inline] Returns: true if the path is character special (a character device file). Definition at line 150 of file filepath.h. bool zipios::FilePath::isDirectory () const [inline] Returns: true if the path is a directory. Definition at line 143 of file filepath.h. bool zipios::FilePath::isFifo () const [inline] Returns: true if the path is a Fifo (a pipe). Definition at line 171 of file filepath.h. bool zipios::FilePath::isRegular () const [inline] Returns: true if the path is a regular file. Definition at line 136 of file filepath.h. bool zipios::FilePath::isSocket () const [inline] Returns: true if the path is a socket. Definition at line 164 of file filepath.h. FilePath zipios::FilePath::operator+ (const FilePath &name) const [inline] Concatenates FilePath objects. A file separator is inserted if appropriate. Definition at line 111 of file filepath.h. void zipios::FilePath::pruneTrailingSeparator () [inline, protected] Prunes the trailing separator of a specified path. Definition at line 100 of file filepath.h. Author Generated automatically by Doxygen for Zipios++ from the source code. Zipios++ Mon Oct 10 2011 zipios::FilePath(3)
All times are GMT -4. The time now is 10:04 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy