10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
Hello
I've got a certain no. of files in a directory whose names I'm reading and redirecting into a temporary text file using the command below:
ls -l | grep ^- | awk '{print $9}'However, whenever the file names contain spaces the above command considers only the part of the file name up to... (5 Replies)
Discussion started by: S. BASU
5 Replies
2. Shell Programming and Scripting
hi,
i have a directory which contains some files and a subdirectory. i am writing only the files names to a file using the below code.
ls -ltr | grep "^-" | awk '{print $NF}' > /home/file_list$$
cat /home/file_list$$
s1_abc.txt
s2_def.xls
s3_def.xls
as you can see there is one .txt... (7 Replies)
Discussion started by: Little
7 Replies
3. Shell Programming and Scripting
I have a filename with a bunch of periods that I want to replace with underscores, but I don't want to change the extension.
Ex: I want
file.test1.f-1.fig.eps
to be
file_test1_f-1_fig.eps
Using awk, the following line will replace ALL periods with underscores, but I want to leave the... (2 Replies)
Discussion started by: erinbot
2 Replies
4. Shell Programming and Scripting
Hi,
I need a command to read extension of files. Could anyone please help me? (14 Replies)
Discussion started by: priyadarshini
14 Replies
5. UNIX for Dummies Questions & Answers
Hi there,
I'm pretty new to UNIX and have tried trawling through this forum to find an answer to what I want to try to do, which I'm sure is very simple but I don't know how to do it.
What I have a a folder that contains multiple files that I have copied from Windows and I want to remove the... (5 Replies)
Discussion started by: johnmcclintock
5 Replies
6. Shell Programming and Scripting
Hi All,
I have a status.txt file which contains following three files.
1.xml
2.xml
3.xml
Now i have written a shell script 1.sh which contains the following
cat status.txt | while read filename
do
echo $filename
case "$filename" in
xml)
echo "running 1.xml"
;;
... (3 Replies)
Discussion started by: sunitachoudhury
3 Replies
7. Shell Programming and Scripting
Hi,
I'm trying to write a script that reads filenames from a file and use these filenames in a loop. The filenames are all on one line and the problem is that these filenames have wildcards like * and braces like in them.
Right now what I'm doing is something like this:
echo "reading from... (0 Replies)
Discussion started by: warp17
0 Replies
8. UNIX for Dummies Questions & Answers
One of my colleagues is having an issue moving files between a windows box and the AIX servers in the office.
The filenames are being truncated though i don't know to what extent. He's using Nero to burn the CD and I think he mentioned he's using Joliet.
I found another thread that shows a... (1 Reply)
Discussion started by: categoryzd
1 Replies
9. UNIX for Dummies Questions & Answers
Hi -
I'm stuck. I have a group of text files created using the split command. My files have the names "projectaa", "projectab", "projectac", etc. What I want to do is add the extension ".txt" to each file. I think I've got part of a sed command together, but I'm stuck on my regex - I keep getting... (9 Replies)
Discussion started by: pepintheshort
9 Replies
10. UNIX for Dummies Questions & Answers
UNIX Sun Ultra60 5.5.1
Hello everybody, I have a problem that seems simple but turns out to be complex (for me at least). My program needs to open a directory (this part is easy), scan each filename and determine whether or not a file with the suffix (.07) exists. So the program would return... (5 Replies)
Discussion started by: j_t_kim
5 Replies