Sponsored Content
Top Forums Shell Programming and Scripting Remove the last 15 characters of a filename with respect to leave file extension Post 302881505 by kurumi on Monday 30th of December 2013 02:49:57 AM
Old 12-30-2013
Code:
# echo $mp4
VFX_Official_Trailer_(HD)__Shhh__-_by_Freddy_Chavez_Olmos_&_Shervin_Shoghian-[YT-f22][Ht2aZLf8q_8].mp4

# echo "$mp4"| ruby -e 's=gets; puts s.gsub(/[&-]+/,"_").gsub(/_+/,"-").split("-")[0..-4].join("-") + ".mp4" '
VFX-Official-Trailer-(HD)-Shhh-by-Freddy-Chavez-Olmos-Shervin-Shoghian.mp4

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need to only remove parenthesis and : leave the rest

Hi all, I'm stuck on this last part...am running a simple script under AIX to extract NetView host IP addresses. The line below returns the IP address in parenthesis with a trailing colon, i.e. ping -c 1 $name |grep \( | awk '{ print $3 }' --------> returns (a.b.c.d): How can I only... (10 Replies)
Discussion started by: livinthedream
10 Replies

2. Shell Programming and Scripting

remove file extension

Hi ALL, I'm new to this forum. Thanks and congrats to all for their great efforts building this site simply superb for all unix administrators. My requirement is to remove extensions of the files in the current directory. I'm doing it using below script which is working but i think it is... (12 Replies)
Discussion started by: prvnrk
12 Replies

3. Shell Programming and Scripting

remove special characters from filename recursively

hi: i have several thousand files from users and of course they use all kind of characters on filenames. I have things like: My special report (1999 ) Lisa & Jack's work.doc crazy. How do I remove all this characters in the current dir and subdirs too? Thanks. (3 Replies)
Discussion started by: jason7
3 Replies

4. Shell Programming and Scripting

sed script to remove nth characters from end of filename

Hi all, I have this basic script to remove, in this case 9 characters from the end of a file name. This is what I have so far, for file in *.mov do newname=`echo $file | sed 's/\(.*\)........./\1/' ` mv "$file" "$newname" done The problem is that it removes the file extension as well.... (2 Replies)
Discussion started by: Monkey Dean
2 Replies

5. Shell Programming and Scripting

Remove filename is text file

Hello, I got files full path in a text file like that /main/k/kdelibs/kdelibs4c2a_3.5.10.dfsg.1-2ubuntu7_i386.deb /main/k/kdelibs-experimental/libknotificationitem-dev_4.3.2-0ubuntu1_i386.deb /main/k/kdemultimedia/dragonplayer_4.3.2-0ubuntu1_i386.deb... (13 Replies)
Discussion started by: davidkhan
13 Replies

6. Shell Programming and Scripting

[Solved] remove file extension

Hi, I have some files with some extension e.g. abc.xml.REMOVE,xyz.xml,efg.xml.REMOVE . I have to remove the .REMOVE extension. I can display it using the below script but cannot rename it. ls -l|sed 's/\.REMOVE//' How can I rename this? Thanks in advance (7 Replies)
Discussion started by: babom
7 Replies

7. Shell Programming and Scripting

Filename rename with characters of file

Hi, I need a bit of help. I've used awk to get the first 7 characters of a file - awk '{print substr($0,0,7)}' test.csv How do I now take this variable to rename test.csv to variable.csv ? Any help or advice would be greatly appreciated! (2 Replies)
Discussion started by: sianm
2 Replies

8. Shell Programming and Scripting

Remove the file except with particular extension

Hi all i am new for the shell scripting can any one help me with my requirments . i want to delete file older than 21 days everything works fine but in that dir i got the files with should not be deleted with particular extension like (.info):confused:here is the script i wrote .can anyone... (5 Replies)
Discussion started by: vikatakavi
5 Replies

9. Shell Programming and Scripting

Remove the last 9 characters of a filename

Hi All! Please can someone help, I have a dir with the following files: ~-rw-r--r-- 1 emmuser users 2087361 Oct 16 15:50 MPGGSN02_20131007234519_24291.20131007 -rw-r--r-- 1 emmuser users 2086837 Oct 16 15:50 MPGGSN02_20131007233529_24272.20131007 -rw-r--r-- 1 emmuser ... (7 Replies)
Discussion started by: fretagi
7 Replies

10. Shell Programming and Scripting

How to remove filename from output file?

Hello, I am trying to print searched multiple keywords in multiple files. It is almost okay with the code but the code puts filename in front of each line. How may I get rid of it? -grep -A1 'word1' *.txt | grep -A1 'word2' | grep -A1 'word3' I expect: Real outcome: How may I... (3 Replies)
Discussion started by: baris35
3 Replies
PAM-AUTH-UPDATE(8)					      System Manager's Manual						PAM-AUTH-UPDATE(8)

NAME
pam-auth-update - manage PAM configuration using packaged profiles SYNOPSIS
pam-auth-update [--package [--remove profile [profile...]]] [--force] DESCRIPTION
pam-auth-update is a utility that permits configuring the central authentication policy for the system using pre-defined profiles as sup- plied by PAM module packages. Profiles shipped in the /usr/share/pam-configs/ directory specify the modules, with options, to enable; the preferred ordering with respect to other profiles; and whether a profile should be enabled by default. Packages providing PAM modules reg- ister their profiles at install time by calling pam-auth-update --package. Selection of profiles is done using the standard debconf inter- face. The profile selection question will be asked at `medium' priority when packages are added or removed, so no user interaction is required by default. Users may invoke pam-auth-update directly to change their authentication configuration. The script makes every effort to respect local changes to /etc/pam.d/common-*. Local modifications to the list of module options will be preserved, and additions of modules within the managed portion of the stack will cause pam-auth-update to treat the config files as locally modified and not make further changes to the config files unless given the --force option. If the user specifies that pam-auth-update should override local configuration changes, the locally-modified files will be saved in /etc/pam.d/ with a suffix of .pam-old. OPTIONS
--package Indicate that the caller is a package maintainer script; lowers the priority of debconf questions to `medium' so that the user is not prompted by default. --remove profile [profile...] Remove the specified profiles from the system configuration. pam-auth-update --remove should be used to remove profiles from the configuration before the modules they reference are removed from disk, to ensure that PAM is in a consistent and usable state at all times during package upgrades or removals. --force Overwrite the current PAM configuration, without prompting. This option must not be used by package maintainer scripts; it is intended for use by administrators only. FILES
/etc/pam.d/common-* Global configuration of PAM, affecting all installed services. /usr/share/pam-configs/ Package-supplied authentication profiles. AUTHOR
Steve Langasek <steve.langasek@canonical.com> COPYRIGHT
Copyright (C) 2008 Canonical Ltd. SEE ALSO
PAM(7), pam.d(5), debconf(7) Debian 08/23/2008 PAM-AUTH-UPDATE(8)
All times are GMT -4. The time now is 12:57 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy