Renaming file that has multiple numbers as filename
Hi
I have a file with filename as "partition-setup-and-ipl.vtcmd.76217657132.9721536798"
Now i need to move this file as "partition-setup-and-ipl.vtcmd.76217657132.9721536798_org"
i tried with
Code:
# ls | grep -E "partition-setup-and-ipl.vtcmd.[0-9]+"
partition-setup-and-ipl.vtcmd.76217657132.9721536798
# mv partition-setup-and-ipl.vtcmd.[0-9]+ partition-setup-and-ipl.vtcmd.[0-9]+_org
mv: cannot rename partition-setup-and-ipl.vtcmd.[0-9]+ to partition-setup-and-ipl.vtcmd.[0-9]+_org:
No such file or directory
I feel i miss something in regular expression.. Please Help
In a shell script I would like to use a compressed file name, i.e. with suffix of .Z, as a file input $1. After the file in uncompressed, I would like to use the file name without the .Z . How do I do this?
Thank you. (8 Replies)
Hi All,
I have a number of files in a directory that I would like to rename - I am quite aware that you can use the mv command to rename the files - I would like to rename them automatically from the command line instead of having to do them singly. I have searched the forum pertaining to... (4 Replies)
Hi there,
Firstly, I have no experience with shell scripts so would really appreciate some help.
I have the following shell script that is causing some problems:
moveit()
{
&& set -x
if
then
DOUBLE_DELIVERY=$(grep... (6 Replies)
Hi,
I have several files with name
b1.root, b2.root b3.root
I want to rename the "b" to "bkg", so finally is should be:
bkg1.root bkg2.root bkg3.root
I used command:
rename s/b/bsig/ b*root
Somehow it is working at some place and not working in other folder. I do not have any idea... (3 Replies)
I got a game that output map tiles of the session with the 0,0 position at the place you login/spawn.
That makes making a map somewhat troublesome since the 0,0 will move.
So I've been looking for a way to change the numbers in the filenames of all files in a folder by a certain value.
The... (5 Replies)
Hi friends ,
i want to change the filename as below
filename=ABC_HYND_JDHD_20130125120345.txt
expected output : ABC_HYND_JDHD_20130125.txt
i have tried using awk but not able to procedd futher. i am trying to do the above in single commad.
echo... (3 Replies)
Hi,
I have a lot of files similar to the below order. I want to rename all the files .discrading the time stamp/numbers after cnf.
Existing files
id_info_20130405.cnf_20130801
in_info_20130405.cnf_20130891
iz_info_20130405.cnf_20130821
in_info_20130405.cnf_20130818... (2 Replies)
Hi
I can do simple file renaming but this task is slightly more troublesome
Ive got a guy that gives me multiple .pdf filles in a directory named
something like
3412345.pdf
4565465.pdf
8534534.pdf
And he also gives me a html file which is tabled with which shows the filenames above... (2 Replies)
Hi all,
Newbie here. First of all, sorry if I made any mistakes while posting this question in terms of rules. Correct me if I am wrong. :b:
I have a .dat file whose name is in the format of 20170311_abc_xyz.dat. The file consists of records whose first column consists of multiple dates in... (2 Replies)
Greetings. I am working in a Linux environment and am trying to figure out a way to rename files in a directory by appending a unique strings that appears within a certain area in those files. I have gotten as far as identifying what that particular unique string is with a command like the... (10 Replies)
Discussion started by: HLee1981
10 Replies
LEARN ABOUT NETBSD
callback_head_init
CALLBACK(9) BSD Kernel Developer's Manual CALLBACK(9)NAME
callback -- generic callback interface
SYNOPSIS
#include <sys/callback.h>
void
callback_head_init(struct callback_head *ch, int ipl);
void
callback_head_destroy(struct callback_head *ch);
void
callback_register(struct callback_head *ch, struct callback_entry *ce, void *obj, int (*fn)(struct callback_entry *, void *, void *));
void
callback_unregister(struct callback_head *ch, struct callback_entry *ce);
int
callback_run_roundrobin(struct callback_head *ch, void *arg);
DESCRIPTION
The generic callback interface allows lower-level layer code to execute a registered function, or set of functions, from the higher-level
layer.
Registered functions must return one of these constants:
CALLBACK_CHAIN_CONTINUE
Indicates that the function call was successful. The following functions in the chain will be called.
CALLBACK_CHAIN_ABORT
Indicates a failure case in the function call. Any following functions in the chain will not be executed.
FUNCTIONS
The callback structure callback_head should be initialized and destroyed using the functions described below. This structure contains the
list of callback entries and other internal data.
The callback_entry structure is an entry, normally associated with the higher-level object. It contains the internal data of the callback
interface.
callback_head_init(ch, ipl)
Initialize the callback structure specified by ch. The highest IPL at which this callback can be used is specified by ipl.
callback_head_destroy(ch)
Destroy the callback structure specified by ch. The caller must unregister all functions before destroying the callback structure.
callback_register(ch, ce, obj, fn)
Register the callback function in the callback structure specified by ch. ce should point to the entry structure of the callback
object. The callback object itself is specified by obj. The function pointer is specified by fn.
callback_unregister(ch, ce)
Unregister the callback function from the structure specified by ch. The entry should be passed as ce. This function may block.
callback_run_roundrobin(ch, arg)
Executes all functions registered in the callback structure, specified by ch. The functions are executed in round-robin fashion.
The value of arg will be passed to the callback functions.
CODE REFERENCES
The callback interface is implemented within the file sys/kern/subr_callback.c.
SEE ALSO intro(9)BSD October 28, 2009 BSD