02-26-2013
The answer that bipinajith gave is a example of Parameter expansion. Check this link for more details.
Shell Command Language
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi all,
I need to replace automatically all special characters of one filename with some corresponding characters
For example >
ö --> oe
ä --> ae
....
If the special character comes more than one time, then all the coccuerences have to be replaced.
I would like to have a... (6 Replies)
Discussion started by: MAKY
6 Replies
2. UNIX for Dummies Questions & Answers
Hi,
If I have a directory full of say 100 random files, and I would like to organize them, for example: FILE001, FILE002, FILE003, FILE004, etc.
How would I do this from Terminal, instead of manually changing each file? I'm using Mac OS X, if that makes a difference.
Thank you in advance... (8 Replies)
Discussion started by: andou
8 Replies
3. Shell Programming and Scripting
Hello,
I have some files in a directory like:
01_07_2010_aa.txt
01_07_2010_bb.txt
01_07_2010_cc.txt
01_07_2010_dd.txt
01_07_2010_ee.txt
01_07_2010_ff.txt
I want to change their names to :
3nm_aa.txt
3nm_bb.txt
3nm_cc.txt
3nm_dd.txt
3nm_ee.txt
3nm_ff.txt (8 Replies)
Discussion started by: ad23
8 Replies
4. Shell Programming and Scripting
Hi is it possible to change multiple files (~10k) names with out disturbing the data in it. ?
input
Hynda|cgr10(+):100027702-1000312480|.txt
Hynda|cgr10(+):100027702-1000312483|.txt
Hynda|cgr10(+):100027702-1000312484|.txt
Hynda|cgr10(+):100027702-1000312482|.txt
output... (4 Replies)
Discussion started by: quincyjones
4 Replies
5. Shell Programming and Scripting
I have 84 files with the following names splitseqs.1, spliseqs.2 etc.
and I want to change the .number to a unique filename.
E.g.
change splitseqs.1 into splitseqs.7114_1#24
and
change spliseqs.2 into splitseqs.7067_2#4
So all the current file names are unique, so are the new file names.... (1 Reply)
Discussion started by: avonm
1 Replies
6. UNIX for Dummies Questions & Answers
I have fasta files with multiple sequences in each. I need to change the sequence name headers from:
>accD:_59176-60699
ATGGAAAAGTGGAGGATTTATTCGTTTCAGAAGGAGTTCGAACGCA
>atpA_(reverse_strand):_showing_revcomp_of_10525-12048
ATGGTAACCATTCAAGCCGACGAAATTAGTAATCTTATCCGGGAAC... (2 Replies)
Discussion started by: tyrianthinae
2 Replies
7. Shell Programming and Scripting
Hi,
How can I change following file name in a bash script?
From file names: myfile-module-1.0-3.0.el6.x86_64.package
To file names: myfile-module1_0-1.0-3.0.el6.x86_64.package
^ ^ ^ ^ ^ ^ ^ ^
Basically, the digit 1.0 is a version number, the digit 3.0 is... (11 Replies)
Discussion started by: hce
11 Replies
8. Shell Programming and Scripting
Hi,
I have a files in a directory as below :-
ls -1
mqdepth-S1STC02
proc-mq-S1STC01
proc-mq-S1STC02
proc-mq-S1STC03
Whereever i have S1STC i need to copy them into new file with file name S2STC.
expected output :-
ls -1
mqdepth-S2STC02
proc-mq-S2STC01
proc-mq-S2STC02... (3 Replies)
Discussion started by: satishmallidi
3 Replies
9. Shell Programming and Scripting
Data files coming in different names in a file name called process.txt.
1. shipments_yyyymmdd.gz
2 Order_yyyymmdd.gz
3. Invoice_yyyymmdd.gz
4. globalorder_yyyymmdd.gz
The process needs to discard all the below files and only process two of the 4 file names available
... (1 Reply)
Discussion started by: dsravanam
1 Replies
10. Shell Programming and Scripting
I have a landing directory on my unix (solaris) server, that receives the following files:
MLH4301I AAOT-hhslog.610.20150805.txt
MLH4301I AAOT-hhslog.611.20150805.txt
MLH4301I AAOT-hhslog.612.20150805.txt
MLH4301I AAOT-hhslog.613.20150805.txt
and I need to add to this files the number 10000... (6 Replies)
Discussion started by: fretagi
6 Replies
LEARN ABOUT POSIX
pts_rename
PTS_RENAME(1) AFS Command Reference PTS_RENAME(1)
NAME
pts_rename - Changes the name of a Protection Database entry
SYNOPSIS
pts rename -oldname <old name> -newname <new name>
[-cell <cell name>] [-noauth] [-localauth]
[-force] [-help]
pts ren -o <old name> -ne <new name> [-c <cell name>]
[-no] [-l] [-f] [-h]
DESCRIPTION
The pts rename command changes the name of the user, machine, or group entry specified by the -oldname argument to the name specified by
the -newname argument. It is not possible to change a user or machine entry's name to look like a regular group entry's name (have a colon
in it).
Members of the system:administrators group can change a regular group name into a prefix-less name and vice versa. When changing a prefix-
less group name into a regular group name or a regular group name to another regular group name, the owner field of the new name (the part
before the colon) must correctly reflect the group's owner.
Changing a regular group's owner with the pts chown command automatically changes the owner field (the part before the colon) of the
group's name, but does not change the owner field of any groups owned by the group. Use this command to rename those groups to a form that
accurately reflects their ownership.
CAUTIONS
By convention, many aspects of an AFS user account have the same name as the user's Protection Database entry, including the Authentication
Database entry, volume, and mount point. When using this command to change a user name, also change the names of all related entities to
maintain consistency. For instructions, see the chapter on user accounts in the OpenAFS Administration Guide.
OPTIONS
-oldname <old name>
Specifies the current full name of the entry.
-newname <new name>
Specifies the new full name for the entry. For regular groups, the owner field (the part before the colon) of the new name must reflect
the actual ownership of the group.
-cell <cell name>
Names the cell in which to run the command. For more details, see pts(1).
-force
Enables the command to continue executing as far as possible when errors or other problems occur, rather than halting execution at the
first error.
-help
Prints the online help for this command. All other valid options are ignored.
-localauth
Constructs a server ticket using a key from the local /etc/openafs/server/KeyFile file. Do not combine this flag with the -cell or
-noauth options. For more details, see pts(1).
-noauth
Assigns the unprivileged identity anonymous to the issuer. For more details, see pts(1).
EXAMPLES
The following example changes the name of the group staff, owned by the privileged user "admin", to "admin:staff":
% pts rename -oldname staff -newname admin:staff
The following example changes the name of the group "admin:finance" to the group "finance". The issuer must belong to the
system:administrators group.
% pts rename -oldname admin:finance -newname finance
PRIVILEGE REQUIRED
To change a regular group name to a prefix-less name or vice versa, or to change a user or machine entry's name, the issuer must belong to
the system:administrators group.
To change a group name to a new name of the same type (regular or prefix-less), the issuer must own the group or belong to the
system:administrators group.
SEE ALSO
pts(1), pts_chown(1)
COPYRIGHT
IBM Corporation 2000. <http://www.ibm.com/> All Rights Reserved.
This documentation is covered by the IBM Public License Version 1.0. It was converted from HTML to POD by software written by Chas
Williams and Russ Allbery, based on work by Alf Wachsmann and Elizabeth Cassell.
OpenAFS 2014-04-08 PTS_RENAME(1)