Sponsored Content
Top Forums Shell Programming and Scripting Errors trying to use all files of a type Post 302955242 by Corona688 on Tuesday 15th of September 2015 05:04:58 PM
Old 09-15-2015
You are just removing the '.bam', you are not removing the long pathname.

Try FILE=$(basename "$FILE") to remove the path.
 

8 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

deleting files by type (symbolic links)

How do I delete just the symbolic links in a directory? I have files that I wish to keep that have similar names, length and date/time. Can I use file size? Thanks kyle (4 Replies)
Discussion started by: kryan_toolboy
4 Replies

2. UNIX for Advanced & Expert Users

Type v for generated files

Hi All, I was checking some of the files and I got the following entries:- =============== v, 664, serv, serv, version.txt, exe L, 775, serv, serv, start.sh, eventserv ================ Could someone please tell me what does the type"v" and "L" represent to. I have not... (2 Replies)
Discussion started by: shubhranshu
2 Replies

3. UNIX for Advanced & Expert Users

Deleting older files of a particular type

hi This should be easy but i'm obviously missing something obvious. :) I'm looking to delete files from yesterday and older of extension .txt and there a range of subfolders with these files in them. The command runs but doesn't delete anything. SUSE 10. find /testfolder -maxdepth 2 -type f... (6 Replies)
Discussion started by: cmap
6 Replies

4. UNIX for Advanced & Expert Users

find -type d returning files as well as directories

Can anyone see why the following command returns all files and not just the directories as specified? find . -type d -exec ls -F {} \; Also tried find . -type d -name "*" -exec ls -F {} \; find . -type d -name "*" -exec ls -F '{}' \; -print Always returns all files :-\ OS is... (2 Replies)
Discussion started by: tuns99
2 Replies

5. Shell Programming and Scripting

Reading files of different type and same basename

Hi ! all I have need of accessing multiple files of different type same base name, and I want to compare base name if matching then I want to send those 2 files of different type to some program, for further processing my files are like this file_1.txt file_2.txt file_3.txt file_4.txt... (6 Replies)
Discussion started by: Akshay Hegde
6 Replies

6. Shell Programming and Scripting

Delete files of the same type if there are more than 3

hi, I would like to delete files in a folder starting with letters ab and fe and so on. It should only delete if there are more than 3 files of that type in that folder. Please suggest me how to write a script. i am new to this scripting. (4 Replies)
Discussion started by: Sneddy
4 Replies

7. UNIX for Dummies Questions & Answers

Search in one type of files and replace

I am not sure how to search and replace the word in the few specific files. I need to search and replace word in only the name containing pepsi in the filename. (12 Replies)
Discussion started by: ramkumar15
12 Replies

8. Shell Programming and Scripting

Latest list of files of each type

find /tmp/testlog/kSR*"_"2018* -type f -printf '%T@ %p\n' | sort -n | tail -3 | cut -f2- -d" " /tmp/testlog/log/KSR04_2018-07-05.log /tmp/testlog/log/KSR04_2018-07-06.log /tmp/testlog/log/KSR01_2018-07-06.log But, I would see the following output(latest files for each KSR tuype) ... (3 Replies)
Discussion started by: jhonnyrip
3 Replies
EJECT(1)						    BSD General Commands Manual 						  EJECT(1)

NAME
eject -- eject a floppy disk, cdrom or tape SYNOPSIS
eject [-fv] [-l | -L | -U] [-t device-type] [-d] device eject -n DESCRIPTION
The eject program ejects a medium from the specified device. It can also load a cdrom in the drive if this operation is supported by the hardware. The device argument specifies a device either by its full path name (identified by a /dev/ prefix), or by one of the built-in nicknames. If the medium contains a file system that is currently mounted, eject will attempt to unmount the file system before ejecting. The following options are available: -d Deprecated. -f Force the eject operation without attempting to unmount any file systems first. -l Load media in the drive (only supported for the cdrom device type). -L Lock the media into the drive (but see BUGS below). -n List the built-in nicknames on standard output. -t device-type Specify the device type. The argument must be one of diskette, floppy, cdrom, disk, or tape. This option is necessary when ejecting a device for which no built-in knowledge is available. -U Unlock the media from the drive. -v Display some of the actions taken on standard output. BUGS
Most disk drivers automatically lock the media on the first open and unlock it on the last close, making 'eject -L' almost useless, since when it closes the device, it gets unlocked again. BSD
October 6, 2001 BSD
All times are GMT -4. The time now is 04:03 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy