Sponsored Content
Top Forums Shell Programming and Scripting How do I take out(remove) the date part in the file name in a script? Post 302871781 by kthri_82 on Thursday 7th of November 2013 01:07:21 AM
Old 11-07-2013
How do I take out(remove) the date part in the file name in a script?

Hi All,

I need to create links between two directories.

have multiple files in a specified location.
Source Location ex: /opt/xdm/input/
Target Location ex: /opt/xdm
input file names: 1. abc_app.aus.apac.yyyymmdd.dtd
2. abcd_app.aus.apac.yyyymmdd.dtd
I need to build a code that reads all the files from the location and cuts the date part from the file name and creates a soft link in a target directory.

Expected links files:
1. abc_app.aus.apac.dtd -- abc_app.aus.apac.yyyymmdd.dtd

There are separate dated directories for source and target and links will be created in those dated directories

can u help me out with the code?

Waiting for your reply!!!!!!!!!!!!!
 

10 More Discussions You Might Find Interesting

1. HP-UX

How do I take out(remove) the date part in the file name?

Hi Guys here I am again, I have two files in a specified location. Location ex: /opt/xdm/input/ input file names: 1. abc_app.yyyymmdd.dtd 2. abd_app.yyyymmdd.dtd I need to build a code that reads the files from the location based on the oldest date and cuts the date part... (5 Replies)
Discussion started by: ruthless
5 Replies

2. Shell Programming and Scripting

remove certain part of file name

Hi, Is it possible to remove the first part of the file name using find. i.e i have something like 2006abc.txt , 1007bed.txt etc, I wanna rename them to abc.txt , bed.txt I tried some stupid way.. find . -name '*.txt' -exec mv {} `cut -f2-5 -d"_" {}` \; somehow iam not getting it. ... (3 Replies)
Discussion started by: braindrain
3 Replies

3. Shell Programming and Scripting

Remove part of the file

I have an xml file, from where I need to take out Application2 entries and keep the others. I need to remove from <product> to </product> and the key element to look for while removing should be <application> as other pairs can be same for others. <product> ... (10 Replies)
Discussion started by: chiru_h
10 Replies

4. Shell Programming and Scripting

Remove part of a column in a text file

I have a text file with delimiter "|" and sometimes the zipcode is in "5th" column or "6th" column. I want to scan the file and remove the "-2323" from the zipcode which has zip+4 digits From blah|blah|foo|bar||blah|945523-232|USA blah|blah|foo|bar||blah|foo|94555-2323|USA To... (8 Replies)
Discussion started by: gubbu
8 Replies

5. UNIX for Dummies Questions & Answers

Remove part of file name with sed & mv

Ok, so I have bunch of files that are named "orange__file_name.asm" and I want to batch rename them to "file_name.asm" I know that using "ls | sed s/orange__//" will get rid of the part of the file name I do not want. But how do I combine that with the mv command to actually do it? Thanks JG (5 Replies)
Discussion started by: john galt
5 Replies

6. UNIX for Dummies Questions & Answers

Remove part of file names in a directory

Hi, i have a directory full of pictures, .jpg files. Half of them begin with "beach_" (for ex beach_123_123456.jpg) i'm looking for a command to remove the "beach_" from all files in the directory. thanks (4 Replies)
Discussion started by: robertmanalio
4 Replies

7. Shell Programming and Scripting

Remove part of a file based on identifiers

here below is a part of the file cat fileName.txt NAME=APP-VA-va_mediaservices-113009-VA_MS_MEDIA_SERVER_NOT_PRESENT-S FIXED=false DATE= 2013-02-19 03:46:04.4 PRIORITY=HIGH RESOURCE NAME=ccm113 NAME=APP-DS-ds_ha-140020-databaseReplicationFailure-S FIXED=false DATE= 2013-02-19... (4 Replies)
Discussion started by: vivek d r
4 Replies

8. Shell Programming and Scripting

How to remove the date part of the file?

Hi Gurus, I have file name like: abcd.20131005.dat I need to remove mid part of data final name should be abcd.dat thanks in advance (2 Replies)
Discussion started by: ken6503
2 Replies

9. Shell Programming and Scripting

Please help, need to create script to remove lines by date in file

Please Help (novice to PERL and SHELL scripting)…. Need to create a script which removes all lines in $filename = "cycle_calendar_ftp_out" older than current date – a variable which will be a number of days passed to script. For Ex it will look at the end date which is the last field (4) and... (2 Replies)
Discussion started by: m3pwr
2 Replies

10. Shell Programming and Scripting

Remove part of the file using a condition

Gents, Is there the chance to remove part of the file, Taking in consideration this condition. For each record the first row start with the string % VE should be 56 rows for each records.. first row = % VE last row = % sw total 56 rows for each record. Then in the case that the... (4 Replies)
Discussion started by: jiam912
4 Replies
xdm.options(5)							File Formats Manual						    xdm.options(5)

NAME
xdm.options - configuration options for the X display manager DESCRIPTION
/etc/X11/xdm/xdm.options contains a set of flags that determine some of the behavior of the X display manager xdm(1x). Most of xdm's behavior is customized through other files; consult the xdm manual page if this manual page does not describe the behavior you want to alter. /etc/X11/xdm/xdm.options may contain comments, which begin with a hash mark ('#') and end at the next newline, just like comments in shell scripts. The rest of the file consists of options which are expressed as words separated by hyphens, with only one option per line. Options are enabled by simply placing them in the file; they are disabled by prefixing the option name with 'no-'. Available options are: ignore-nologin Normally, if the nologin(5) file exists, its contents will be displayed using xmessage(1x) (if xmessage is available), and the user will be returned to the xdm login screen after xmessage is dismissed instead of starting the X session. If this option is enabled, xdm starts a session as usual (after xmessage is dismissed, if xmessage is available and the nologin file exists). This behavior is disabled by default: nologin is heeded, not ignored. restart-on-upgrade Enable this option with caution on 'production' machines; it causes the daemon to be stopped and restarted on upgrade, even if the process has children (which means it is managing X sessions). Typically when a package that contains a daemon is being installed or upgraded, its maintainer scripts stop a running daemon process before installing the new binary, and restart it after the new binary is installed. Stopping xdm causes immediate termination of any sessions it manages; in some situations this could be an unwelcome surprise (for instance, for remote xdm users who had no idea the administrator was performing system maintenance). On the other hand, for machines that stay up for long periods of time, leaving the old daemon running can be a bad idea if the new version has, for instance, a fix for a security vulnerability (overwriting xdm's executable on the file system has no effect on the copy of xdm in memory). The xdm package's pre-removal script checks to see if the xdm process has any children; if it does, it is possible that someone's session would be killed by stopping xdm, so a warning is issued and an opportunity to abort the upgrade of xdm is pro- vided. Furthermore, restarting xdm on upgrade can be surprising, because a locally-managed X server can change the active VT even while other packages are continuing to upgrade. If, by intent or accident, the X server does not honor the key sequence to switch VTs back to a virtual console, this can be undesirable. This behavior is disabled by default: xdm will be not be stopped or started during an upgrade of its package; the administrator will have to do so by hand (with invoke-rc.d xdm restart or by rebooting the system) before the newly installed xdm binary is used. start-on-install Enable this option with caution; it causes the xdm daemon to be started immediately after the package is installed. See the above entry regarding restart-on-upgrade for other caveats regarding the consequences of starting the xdm daemon during package manage- ment. This behavior is disabled by default: xdm will not be started when it is installed. Changing this setting can affect future installs if the package is removed, but not purged (which removes 'conffiles', including xdm.options). use-sessreg This option causes the /etc/X11/xdm/Xreset script to call the sessreg(1x) program to register X sessions managed by xdm in the utmp(5) and wtmp(5) files. If it is disabled, the utmp and wtmp files will have no record of xdm sessions. This behavior is enabled by default; sessreg will be used. Users of older versions of the Debian system should note that the 'run-xconsole' option has been removed. The shell script named /etc/X11/xdm/Xreset can be edited to disable or modify the running of xconsole on the xdm greeter screen; see xdm(1x) for more information. AUTHORS
Stephen Early, Mark Eichin, and Branden Robinson customized xdm's startup and reset scripts and package maintainer scripts to implement the functionality described above. This manual page was written by Branden Robinson. SEE ALSO
sessreg(1x), xmessage(1x), xdm(1x), nologin(5), utmp(5), wtmp(5) Debian Project 2004-10-31 xdm.options(5)
All times are GMT -4. The time now is 07:44 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy