08-16-2005
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Help!
I was trying to rename multiple files. Like in DOS, i decided to use wildcards and now i am missing some files. Any ideas on how to recover them? Or find out where the files went?
I had these 3 files
resume1.log
elecresume.log
compresume.log
The command I ran was
mv *.log *.log.bak... (6 Replies)
Discussion started by: rmayur
6 Replies
2. Shell Programming and Scripting
hi,
I've a machine running RHEL3,kernel version 2.4.
i need to rename multiple files under one directory as follows:
ls
demo.c demo.S demo-1243.sw demo.xyz
and now i need to replace the occurrence of demo with demo_1 for each of the above file. the tedious way is to go ahead and do mv on... (2 Replies)
Discussion started by: amit4g
2 Replies
3. Shell Programming and Scripting
I have a bunch of files txt1.csv--2008 thru to txt3.csv--2008.
If i wanted to rename these files all at the same time to txt*.csv-2008 what would be the best way to do it...
Just need to get rid of the extra - in each file name.. not all files are going to be called txt*.csv--2008. Just... (6 Replies)
Discussion started by: Jazmania
6 Replies
4. Shell Programming and Scripting
Hi,
I have several hundred files I need to rename, and I'm would rather not hit F2 for each file individually to rename them.
Example of file:
large1961.jpg
What I need the file to be renamed as:
1961.jpg
I don't know what type of command I can execute within a shell script that would... (7 Replies)
Discussion started by: jayell
7 Replies
5. UNIX for Dummies Questions & Answers
Hello
i have the files in this format
pdb1i0t.ent
pdb1lv7.ent
pdb1pp6.ent
pdb1tj2.ent
pdb1xg2.ent
pdb2b4b.ent
pdb2ewe.ent
Now i have to remove the prefix pdb from all the files and also i need to change the extension of .ent to .txt
The new file should look like this
... (3 Replies)
Discussion started by: empyrean
3 Replies
6. Shell Programming and Scripting
I've been trying to find information in regard to creating a script that will generate HTML files. I currently have a series of files that contain code I need to surround with a <textarea> tag for easy viewing. I have about a thousand files that contain code, one file that contains the HTML code up... (10 Replies)
Discussion started by: 12o
10 Replies
7. UNIX for Dummies Questions & Answers
I have multiple gif files in a directory with different names.
How can i rename them to have this result:
file01.gif
file02.gif
file03.gif
.
.
.
file0500.gif
Thanks for your help. (3 Replies)
Discussion started by: netx
3 Replies
8. Shell Programming and Scripting
I have 34 file in a directory that all have different names, however, they do have 1 pattern in commmon. They all have "-10-11-2010" date format in the name. I want to replace the date in the file name with a supplied date or maybe even the system date. I am sure I will be using awk or sed to... (9 Replies)
Discussion started by: Harleyrci
9 Replies
9. Shell Programming and Scripting
Hi All,
I am trying to rename the extension of a set of file from .txt to .xtx. When I run the following script,
#!/bin/sh
l=`ls /f`
for f in $l
do "mv $f ${f%.txt}.xtx" ;
done
a file such as 1.txt is renamed to 1? where ? is a strange character. Could you please help me fix the code... (3 Replies)
Discussion started by: sara123
3 Replies
10. Shell Programming and Scripting
Hi,
In sftp script to get files, I have to rename all the files which I am picking. Rename command does not work here. Is there any way to do this?
I am using #!/bin/ksh
For eg: sftp user@host <<EOF
cd /path
get *.txt
rename *.txt *.txt.done
... (7 Replies)
Discussion started by: jhilmil
7 Replies
LEARN ABOUT CENTOS
mmv_stats_init
MMV_STATS_INIT(3) Library Functions Manual MMV_STATS_INIT(3)
NAME
mmv_stats_init - create and initialize Memory Mapped Value file
C SYNOPSIS
#include <pcp/pmapi.h>
#include <pcp/mmv_stats.h>
void *mmv_stats_init(const char *name, int cluster, mmv_stats_flags_t flags, const mmv_metric_t *stats, int nstats, mmv_indom_t *indoms,
int nindoms);
cc ... -lpcp_mmv -lpcp
DESCRIPTION
mmv_stats_init creates and initializes the content of the MMV(5) file, returning a handle that is used in subsequent MMV API calls.
mmv_stats_stop performs an orderly shutdown of the mapping handle returned by an earlier initialization call.
The file is created in the $PCP_TMP_DIR/mmv directory, name argument is expected to be a basename of the file, not the full path. The
metadata content of the file does not change after the file has been created.
The old file is removed unconditionally unless there was an error.
cluster is the preferred MMV PMDA cluster ID to be used for the metrics originating from this call to mmv_stats_init. The flags provide
additional control over the behaviour of the MMV PMDA - e.g. use of MMV_FLAG_PROCESS will ensure values are only exported when the instru-
mented application is running - this is verified on each request for new values.
stats is the array of mmv_metric_t elements of length nstats. Each element of the array describes one PCP metric.
typedef struct {
char name[MMV_NAMEMAX]; /* Name of the metric */
__uint32_t item; /* Item component of PMID */
mmv_metric_type_t type; /* Type of the metric */
mmv_metric_sem_t semantics; /* Semantics of the metric */
pmUnits dimension; /* Dimensions (TIME,SPACE,etc) */
__uint32_t indom; /* Instance domain identifier */
char *shorttext; /* Optional, one-line help */
char *helptext; /* Optional, full help text */
} mmv_metric_t;
If indom is not zero and not PM_INDOM_NULL, then the metric has multiple values and there must be a corresponding indom entry in the indom
list (uniquely identified by serial number).
The stats array cannot contain any elements which have no name - this is considered an error and no metrics will be exported in this case.
indoms is the array of mmv_indom_t elements of length nindoms. Each element of the array describes one PCP instance domain.
typedef struct {
__int32_t internal;
char external[MMV_NAMEMAX];
} mmv_instances_t;
typedef struct {
__uint32_t serial; /* Unique serial number */
__uint32_t count; /* Number of instances */
mmv_instances_t *instances; /* Internal/external IDs */
char *shorttext; /* Short help text */
char *helptext; /* Long help text */
} mmv_indom_t;
RETURNS
The function returns the address of the memory mapped region on success or NULL on failure.
SEE ALSO
mmv_inc_value(3), mmv_lookup_value_desc(3) and mmv(5).
Performance Co-Pilot MMV_STATS_INIT(3)