Sponsored Content
Top Forums Shell Programming and Scripting Need to cut filename in LINUX ksh Post 302323725 by juliyp on Monday 8th of June 2009 09:10:37 PM
Old 06-08-2009
Need to cut filename in LINUX ksh

Hi,
I need to cut filename in Linux ksh.
for example file name is c_xxxx_cp_200908175035.zip. I need to get variable with only c_xxxx_cp value.
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

is LS a fixed length? I want to use cut -c#-# to isolate filename.

-rw-r--r-- 1 fxpbftp fusion 368 Jun 10 08:34 FX_1.11840235236594E12.111234236809956 If I have a long list of files that look like this (they al begni with FX_1.#######.####) Sometimes, there may be less numbers or more in the filename, that varies. I wish to isolate just the... (8 Replies)
Discussion started by: yongho
8 Replies

2. Shell Programming and Scripting

ksh :: want to cut the strings

I have contents like 423562143124/53125351276 sdgas/347236 sjhdk;ls'ald/y62783612763 I need a command that would make the string before / and after / as separate output as (A should contain 423562143124 )and B should contain 53125351276). I tried but in vain. Please help. (19 Replies)
Discussion started by: rollthecoin
19 Replies

3. Shell Programming and Scripting

ksh + isql => output cut at 2 GB

Using a ksh script, I'm dumping the data from our sybase database into an output file. This output file is for what ever reason cut at 2GB. There is enough space on the unix machine and as there is no error message is received I have no clue to start looking for a solution. #!... (1 Reply)
Discussion started by: bereman
1 Replies

4. Shell Programming and Scripting

ksh cut out words from string

Hi, I have: export string1=qwerWhatever export string2=qwerWhatever1 export currdir=`pwd` echo $currdir gives back: /dir/dir/Whatever1 I want to take first 4 letters from string1 (in this case: qwer), compare it to string2 (in this case qwerWhatever1) and if string2 has in it... (8 Replies)
Discussion started by: chish
8 Replies

5. Shell Programming and Scripting

cut filename extension

I need a small script (sh) to remove in a variable the filename extension. Example: f = "testfile.txt" and I need a $a with "testfile". Some one a idea? (4 Replies)
Discussion started by: Essbaumer
4 Replies

6. Shell Programming and Scripting

cut the some part in filename

Hi All, I have the file & name is "/a/b/c/d/e/xyz.dat" I need "/a/b/c/d/e/" from the above file name. I tryning with echo and awk. But it not come. Please help me in this regard. Thanks & Regards, Dathu (3 Replies)
Discussion started by: pdathu
3 Replies

7. Shell Programming and Scripting

Help Needed! - Cut characters after a text string and append to end of filename

Hi all.. I have several unique files that contain one thing in common, and that is acct#. For all files in the directory, I want to append the 10 characters following the word "ACCOUNT:" to the end of the filename. for example: I have file 111_123 that contains ACCOUNT:ABC1234567 The file... (5 Replies)
Discussion started by: cinderella1
5 Replies

8. Shell Programming and Scripting

Cut the filename

Hi , I've the following file names and i need the part of the file name The files are like below FN_DATE_TODAY_20010178654321.txt FN_DATE_LASTDAY_19990178654321.txt and i need to cut the filenames like below FN_DATE_TODAY FN_DATE_LASTDAY How can i achieve that Thanks (5 Replies)
Discussion started by: smile689
5 Replies

9. Shell Programming and Scripting

Need script to cut string from a filename

Hi, I need a script which do below I have a filename: TEST2013_09_17_XX_XX_XX.csv Now script should create a new file with name: XX_XX_XX.csv Or I should say i need the output as XX_XX_XX.csv Please help. Mant thanks in advance (3 Replies)
Discussion started by: sv0081493
3 Replies

10. UNIX for Dummies Questions & Answers

Print/cut/grep/sed/ date yyyymmdd on the filename only.

I have this filename "RBD_EXTRACT_a3468_d20131118.tar.gz" and I would like print out the "yyyymmdd" only. I use this command below, but if different command like cut or print....etc. Thanks ls RBD_EXTRACT* | sed 's/.*\(........\).tar.gz$/\1/' > test.txt (9 Replies)
Discussion started by: dotran
9 Replies
times(1)							   User Commands							  times(1)

NAME
times - shell built-in function to report time usages of the current shell SYNOPSIS
sh times ksh times DESCRIPTION
sh Print the accumulated user and system times for processes run from the shell. ksh Print the accumulated user and system times for the shell and for processes run from the shell. On this man page, ksh(1) commands that are preceded by one or two * (asterisks) are treated specially in the following ways: 1. Variable assignment lists preceding the command remain in effect when the command completes. 2. I/O redirections are processed after variable assignments. 3. Errors cause a script that contains them to abort. 4. Words, following a command preceded by ** that are in the format of a variable assignment, are expanded with the same rules as a variable assignment. This means that tilde substitution is performed after the = sign and word splitting and file name genera- tion are not performed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ SEE ALSO
ksh(1), sh(1), time(1), attributes(5) SunOS 5.11 15 Apr 1994 times(1)
All times are GMT -4. The time now is 03:48 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy