Sponsored Content
Top Forums Shell Programming and Scripting Delete characters from the last "/" Post 302720757 by inaki on Wednesday 24th of October 2012 03:17:37 PM
Old 10-24-2012
Delete characters from the last "/"

Hi,

I have a text file with some lines like this:
Code:
/MEDIA/DISK1/23568742.MOV 
/MEDIA/DISK1/87456321.AVI 
/MEDIA/DISK2/PART1/45753131.AVI 
/IMPORT/44452.WAV 
...

I don't konw how to delete all characters from the last "/" and the text file looks like this:

Code:
/MEDIA/DISK1/
/MEDIA/DISK1/
/MEDIA/DISK2/PART1/
/IMPORT/
...

Thank you.

Iñaki
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies

2. Shell Programming and Scripting

How to remove "New line characters" and "spaces" at a time

Dear friends, following is the output of a script from which I want to remove spaces and new-line characters. Example:- Line1 abcdefghijklmnopqrstuvwxyz Line2 mnopqrstuvwxyzabcdefghijkl Line3 opqrstuvwxyzabcdefdefg Here in above example, at every starting line there is a “tab” &... (4 Replies)
Discussion started by: anushree.a
4 Replies

3. Shell Programming and Scripting

Unix commands delete all files starting with "X" except "X" itself. HELP!!!!?

im a new student in programming and im stuck on this question so please please HELP ME. thanks. the question is this: enter a command to delete all files that have filenames starting with labtest, except labtest itself (delete all files startign with 'labtest' followed by one or more... (2 Replies)
Discussion started by: soccerball
2 Replies

4. Shell Programming and Scripting

Delete files older than "x" if directory size is greater than "y"

I wrote a script to delete files which are older than "x" days, if the size of the directory is greater than "y" #!/bin/bash du -hs $1 while read SIZE ENTRY do if ; then find $1 -mtime +$2 -exec rm -f {} \; echo "Files older than $2 days deleted" else echo "free Space available"... (4 Replies)
Discussion started by: JamesCarter
4 Replies

5. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

6. Shell Programming and Scripting

Delete characters from each line until meet character ":"

Hello, I have file that looks like this : 765327564:line1 94:line2 7865:line3 ..... 765322:linen I want to cut all the digits from the beginning of each line up to ":" character and to have everything like this : line1 line2 line3 ..... linen P.S : content of line1 ...... (8 Replies)
Discussion started by: black_fender
8 Replies

7. Shell Programming and Scripting

finding the strings beween 2 characters "/" & "/" in .txt file

Hi all. I have a .txt file that I need to sort it My file is like: 1- 88 chain0 MASTER (FF-TE) FFFF 1962510 /TCK T FD2TQHVTT1 /jtagc/jtag_instreg/updateinstr_reg_1 dff1 (TI,SO) 2- ... (10 Replies)
Discussion started by: Behrouzx77
10 Replies

8. Shell Programming and Scripting

Find "*.c" and "Makefile" and then delete them with one line

find "*.c" and "Makefile" and then delete them with one line (3 Replies)
Discussion started by: yanglei_fage
3 Replies

9. Shell Programming and Scripting

Delete all log files older than 10 day and whose first string of the first line is "MSH" or "<?xml"

Dear Ladies & Gents, I have a requirement to delete all the log files in /var/log/test directory that are older than 10 days and their first line begin with "MSH" or "<?xml" or "FHS". I've put together the following BASH script, but it's erroring out: for filename in $(find /var/log/test... (2 Replies)
Discussion started by: Hiroshi
2 Replies

10. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies
IY(4)							   BSD Kernel Interfaces Manual 						     IY(4)

NAME
iy -- Intel EtherExpress PRO/10 Ethernet driver (Intel i82595) SYNOPSIS
iy0 at isa? port {port} irq ? DESCRIPTION
The iy device driver supports the EtherExpress PRO/10 card, and might support other ISA cards using the same chip. MEDIA SELECTION
The different models of the supported boards come with some subset of RJ-45, BNC and AUI connectors. Supported media include: AUI/DIX Standard 15 pin connector 10Base2 BNC, also known as thin-net 10BaseT UTP, also known as twisted pair The default port to use is the port the card autodetects at ifconfig up time. To choose an alternative port, an explicit medium can be spec- ified to ifconfig(8) or in your ifconfig.iy? file. NOTES
The EtherExpress PRO card has no jumpers to set the address. Intel supplies software to set the address of the card in software. You have to hardwire this address in your kernel configuration file. SEE ALSO
ed(4), eg(4), el(4), ep(4), intro(4), ix(4), le(4), ifconfig(8) STANDARDS
are great. There's so many to choose from. BSD
May 22, 1996 BSD
All times are GMT -4. The time now is 05:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy