This works in ksh when run in the same directory as the target files: -
Your first post had no spaces in the enclosing strings but your second did as well as having unprintable characters so I created a test file with spaces in as a worst case. Running the code as a script called "inch" with these files: -
i have hundreds of directories that have to be renamed. the directory structure is fairly uniform which makes the scripting a little simpler.
suppose i have many directories like this */*/*/*abc* (in other words i have similar directory names 3 dirs deep that all contain the pattern abc in... (8 Replies)
I am trying to use a loop to strip of the funny character ^M at the end of all lines in each file found in current directory and I have used the following in a script:
find . -type f -name '*.txt' | while read file
do
echo "stripping ^M from ..."
ex - "$file" > $tempfile
%s/^M//g
wq!
# mv... (4 Replies)
I have a number of files in directories labeled like this:
/Data/tr_gray/tr_DTI/dti_FA.nii.gz
(the brackets here represent a range of number that the files are labeled with)
I need to rename each dti_FA.nii.gz file according to the name of the folder it resides in. For example, the file ... (3 Replies)
Hi,
We have a file (e.g. a .csv file, but could be any other format), with 2 columns: the old value and the new value. We need to modify all the files within the current directory (including subdirectories), so find and replace the contents found in the first column within the file, with the... (9 Replies)
Hi all,
I have a many folders with zipped files in them. The zipped files are txt files from different folders. The txt files have the same names. If i try to
find . -type f -name "*.zip" -exec cp -R {} /myhome/ZIP \; it fails since the ZIP files from different folders have the same names and... (2 Replies)
Hi,
I have a directory with a lot of files like this:
a.bam
b.bam
c.bam
I like to rename these files based on a list where the name of the files in the first column will be replasced by the names in the second column. Here is my list which is a tab-delimited text file:
a x
b y
c ... (4 Replies)
Hello, I have a text file "file.list" with the contents below.
file1
filename1
file2
filename2
file3
filename3
file1, file2 and file3 are files existing in the same directory as the text file file.list.
I want to rename file1 to filename1, file2 to filename2, as show in the text... (1 Reply)
Hey guys,
I have wrote the following script to apply a module named "trinity" on my files. (it takes two input files and spit a trinity.fasta as output)
#!/bin/bash -l
#SBATCH -p node
#SBATCH -A <projectID>
#SBATCH -n 16
#SBATCH -t 7-00:00:00
#SBATCH --mem=128GB
#SBATCH --mail-type=ALL... (1 Reply)
Hello!
New here although not completely new to Unix.
I wonder how I could rename files based on the data found in a simple textfile.
It goes like this:
I have 4 files
1 ldfgkkfjslkdfjsldkfjsf.wav
2 nndsdflksdjf.wav
3 sdflksjdf jjsdflsdfl.wav
4 dkadsdddd.wav
Textfile.txt looks like... (14 Replies)
Hello Everyone ,
Iam a newbie to shell programming and iam reaching out if anyone can help in this :-
I have two files
1) Insert.txt
2) partition_list.txt
insert.txt looks like this :-
insert into emp1 partition (partition_name)
(a1,
b2,
c4,
s6,
d8)
select
a1,
b2,
c4, (2 Replies)
Discussion started by: nubie2linux
2 Replies
LEARN ABOUT OSF1
remque
insque(9r)insque(9r)NAME
insque, remque - General: Add or remove an element from the queue
SYNOPSIS
struct generic_qheader {
struct generic_qheader *q_forw;
struct generic_qheader *q_back;
};
int insque(
struct generic_qheader *elem,
struct generic_qheader *pred ); int remque(
struct generic_qheader *elem );
ARGUMENTS
Specifies the address of the queue header that contains the element to be manipulated. Specifies the address of the queue header that con-
tains the element to precede the one specified by elem in the queue.
DESCRIPTION
The insque routine adds the element that the elem argument specifies to the queue. The routine inserts elem in the next position after pred
in the queue.
The remque routine removes the element that the elem argument specifies from the queue it is currently in.
Queues are built from doubly linked lists. Each element is linked into the queue through a queue header. All queue headers are of the
generic form struct generic_qheader. A given element may have multiple queue headers. This allows each element to be simultaneously linked
onto multiple queues.
Any driver routine that manipulates these queues must call an appropriate spl routine to ensure that the spl level is high enough to block
out any interrupts for other kernel modules that may access these queues.
RETURN VALUES
None
SEE ALSO
Routines: spl(9r)insque(9r)