Sponsored Content
Top Forums Shell Programming and Scripting how to retrieve base name of the file Post 302205034 by joeyg on Friday 13th of June 2008 08:32:45 AM
Old 06-13-2008
Computer Another approach

Code:
> A=/bb/data/f233pdb
> B=$(echo "$A" | cut -d"/" -f4)
> C=$(echo "$A" | cut -d"/" -f1-3)"/"

> echo $A
/bb/data/f233pdb
> echo $B
f233pdb
> echo $C
/bb/data/

 

10 More Discussions You Might Find Interesting

1. Ubuntu

How to build as web base File Server

Hi folks, Ubuntu 7.04 server amd64 apache2-2.2.3 postfix-2.3.8 mysql Ver 14.12 SquirrelMail version 1.4.11 I have a running Mail Server. I need to make it as a file server, in addition, allowing users who have accounts (Linux/shell) on the Mail Server to upload/download their files... (1 Reply)
Discussion started by: satimis
1 Replies

2. HP-UX

How to make a loop base on reading a file?

Need help on making a loop script base on what is inside a file... File to read: List.txt List.txt contains below w/c are file name as well: SAMPLEa SAMPLEb SAMPLEc SAMPLEd SAMPLEe SAMPLEf . . . Want to make a loop that will manipulate those that are inside the file.txt w/c are... (3 Replies)
Discussion started by: JohnBalayo
3 Replies

3. UNIX for Dummies Questions & Answers

How to make a loop base on reading a file?

To make it clearer: I have a file, List.txt List.txt contains: (these are actually splitted files w/c I got from ls command and dump them to the List.txt file) SAMPLEa SAMPLEb SAMPLEc SAMPLEd SAMPLEe SAMPLEf . . . . . And I want to rename these files to have a .dat extension.... (3 Replies)
Discussion started by: JohnBalayo
3 Replies

4. Shell Programming and Scripting

retrieve value from a file

hi i have a cfg file,it contains lpdma520.dev.ipc.us.aexp.com=SUBMCORE.REQUEST.FT lpdma521.dev.ipc.us.aexp.com=SUBMCORE.REQUEST.FTREQ lpdma522.dev.ipc.us.aexp.com=SUBMITSECUREFILEFLOW i am retrieving the values using the function RetrieveCfgvalue() { CFG_VALUE=`grep "$2="... (1 Reply)
Discussion started by: satish@123
1 Replies

5. UNIX for Advanced & Expert Users

retrieve the file.

How will retrieve for a particular months file in UNIX say for example from January to February 2008. (1 Reply)
Discussion started by: rajesh08
1 Replies

6. UNIX for Dummies Questions & Answers

Hot to retrieve *.sql file names which we refer in .sh file.

Hi Guys, How to retrieve/get *.sql file names which we refer in all *.sh files. Can any one help me on this. Thanks, Kolipaka (3 Replies)
Discussion started by: lakshmanrk811
3 Replies

7. Shell Programming and Scripting

Copy same name data from other file base on column

HI I have input file A.txt X Y Z File B.txt 1 X 10 AAA 11123 2 Y 22 PlD 4563 3 Z 55 PlD 54645 4 Z 66 PlD 15698 5 F 44 PlD 154798 6 C 55 PlD 12554 7 Z 88 PlD 23265 8 C 99 PlD 151654 9 C 11 PlD 21546546 I need New File C.txt (1 Reply)
Discussion started by: pareshkp
1 Replies

8. Linux

Split a large textfile (one file) into multiple file to base on ^L

Hi, Anyone can help, I have a large textfile (one file), and I need to split into multiple file to break each file into ^L. My textfile ========== abc company abc address abc contact ^L my company my address my contact my skills ^L your company your address ========== (3 Replies)
Discussion started by: fspalero
3 Replies

9. UNIX for Beginners Questions & Answers

UNIX utility to find difference in folder, file and contents of file against a base version

Hi, I am trying to find out whether there are any Unix utilities that compares folders, files and contents within the file and provides a comprehensive report. The comparison can be against base version of a folder and file with content. Can you please let me know of such a utility? Thanks,... (6 Replies)
Discussion started by: Sripathi_ks
6 Replies

10. UNIX for Beginners Questions & Answers

Grep: Retrieve two strings from one file to find them anyone on line in another file

I am having trouble matching *two* strings from one file anywhere in a line of a second file, and could use some help getting this figured out. My preference would be to use grep for this because I would like to take advantage of its -A option. The latter is due to the fact that I would like both... (2 Replies)
Discussion started by: jvoot
2 Replies
XtVaGetSubvalues()														XtVaGetSubvalues()

Name
  XtVaGetSubvalues - retrieve the current values of subpart resources, using varargs argument style.

Synopsis
  void XtVaGetSubvalues(base, resources, num_resources, ..., NULL)
	   XtPointer base;
	   XtResourceList resources;
	   Cardinal num_resources;

Inputs
  base	    Specifies the base address of the subpart data structure for which the resources should be retrieved.

  resources Specifies the subpart resource list.

  num_resources
	    Specifies the number of resources in the resource list.

  ..., NULL A  NULL-terminated	variable-length  list  of  resource  names and the addresses at which the values of those resources are to be
	    stored.

Availability
  Release 4 and later.

Description
  XtVaGetSubvalues() obtains the values of the resources named in the variable-length argument list  (and  described  in  the  resource  list
  resources)  from  the subpart structure pointed to by base, and stores those values at the addresses specified in the variable length argu-
  ment list.  Note that the special symbol XtVaTypedArg is not supported by XtVaGetSubvalues().  If XtVaTypedArg is specified in the list,  a
  warning message is issued and the entry is then ignored.

  XtVaGetSubvalues()  is  identical  to XtGetSubvalues() except that the args array of resource names and values and the num_args argument of
  that function are replaced with a NULL-terminated variable-length argument list.

  See XtGetSubvalues() for more information on this function.  See XtVaSetValues() for more information  on  using  variable-length  argument
  lists to specify resources.  See XtGetApplicationResources() for information on how to declare an XtResourceList.

See Also
  XtGetApplicationResources(1), XtGetSubvalues(1), XtVaSetValues(1).

Xt - Resource Management													XtVaGetSubvalues()
All times are GMT -4. The time now is 07:23 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy