02-16-2016
I knew it had to be something simple, I did not realize it was just a case of ls also needing the IFS to be null too. For my needs both solutions work perfectly but that version is the most flexible.
Thank you so much to you both.
10 More Discussions You Might Find Interesting
1. UNIX for Dummies Questions & Answers
I want to do a search and replace in a file but there may or may not be one space, two or none.
i.e.:
test 3,1
test 3,1
test,3,1
test 3,1
The output I will be looking for is this:
test 3,2
test 3,2
test,3,2... (6 Replies)
Discussion started by: Shakey21
6 Replies
2. Shell Programming and Scripting
I have a problem with the script below
#!/bin/sh
for vo in `find -maxdepth 1 -type f -regex "^\./*$"`
do
ls -l "$vo"
some other commands
done
It works fine until `find ...` returns files with spaces. I've tryed to change IFS but haven't succeed
Any solutions? (4 Replies)
Discussion started by: Hitori
4 Replies
3. Shell Programming and Scripting
I have files on my unix boxes that users have created with spaces.
Example: /tmp/project plan
ls -l "/tmp/project plan" works fine.
$/tmp>ls -l "/tmp/project plan"
-rw-r--r-- 1 root other 0 Jan 31 12:32 /tmp/project plan
I created a file called test and put just the... (2 Replies)
Discussion started by: x96riley3
2 Replies
4. Shell Programming and Scripting
Hi All,
I see similar problems in past threads but so far no answers have worked for me. I am trying to write a script which parses a txt file that contains one filename per line, then finds those files on the local disk and copies them to a specified directory.
What I have:
... (4 Replies)
Discussion started by: naviztirf
4 Replies
5. Shell Programming and Scripting
Hi,
I want to list all the files matching in a directory directory given below
Here one of the folder has a space in the path.
/MAS02/RMS/WBDev/Krishna/Krishna Mohan/FMSplitByKeyAfterChanges1000075383.fileman.*.txt.out.1000075383.0
The following works from command line... (1 Reply)
Discussion started by: hikrishn
1 Replies
6. Shell Programming and Scripting
Hi
I hope someone will be able to resolve this little teaser!
I am running a script
for file in `ls directory`
do
echo "$file"
...other code here....
done
this works fine unless we receive a file with a name which has a space in it
ie
"filena me"
(I know its not good... (8 Replies)
Discussion started by: Bab00shka
8 Replies
7. Shell Programming and Scripting
I want to ftp all the sh files in the directory. Also if any of the file name
contains spaces in them, it should be converted to underscores before it is ftped. I wrote the following code below:
FILESSH=$(ls /mysh/*.sh)
--- FILESH being used here for some other task ---
echo "$FILESSH" |... (3 Replies)
Discussion started by: amicon007
3 Replies
8. Shell Programming and Scripting
Hi experts,
I have the following data: I want the last filed in the output.
How to print the last field , It contains the file names and few filenames with white spaces .
-rw-r--r-- 1 root root 0 2010-04-26 16:57 file1 2space_File.txt
-rw-r--r-- 1 root root 0 2010-04-26... (2 Replies)
Discussion started by: rveri
2 Replies
9. UNIX for Advanced & Expert Users
OS: RHEL 5.8
shell: bash 3.2.25
Directory /home/guest/ contains these files:
file a
file b
file c
fileD
fileE
fileF
testFile.txt
I'm trying to find the syntax to run ls -ltr against this list of files that is contained within a text file, testFile.txt.
The file testFile.txt has... (4 Replies)
Discussion started by: uschaafm
4 Replies
10. Shell Programming and Scripting
I am writing a code that can move and archve all the files in a directory except the latest file based on file pattern provided in a controlfile.
The filename is in the form of pattern. So basically we find the all the files of the pattern provided and archive all of them, leaving one latest file.... (3 Replies)
Discussion started by: Saanvi1
3 Replies
LEARN ABOUT HPUX
list_object
list object(1m) list object(1m)
NAME
list object - Lists the specifies object entries (including clearinghouse object entries)
SYNOPSIS
cdscp list object object-name [with attribute-name = attribute-value]
ARGUMENTS
The full name of a specific object entry. The last simple name can contain wildcard characters. The name of a particular attribute. The
value of a particular attribute.
DESCRIPTION
The list object command displays a list of all the object entries (including clearinghouse object entries) whose names match the object
entry name that you specify. The last simple name can contain wildcard characters. You can use a with attribute-name = attribute-value
clause to limit output only to object entries whose attributes have values equal to the specified values. A space must precede and follow
the = (equals sign).
Privilege Required
You must have read permission to the directory that stores the object entry. If you use a with attribute-name = attribute-value clause in
the command, you also need read or test permission to the selected object entries.
NOTE
This command is replaced at Revision 1.1 by the dcecp command and may not be provided in future releases of DCE.
EXAMPLE
The following command displays a list of all the object entries named in the directory /.:/eng. cdscp> list object /.:/eng/*
LIST
OBJECT /.../abc.com/eng
AT 1991-10-15-15:53:06 juno test_stats work_disk1 work_disk2
RELATED INFORMATION
Commands: add object(1m), create object(1m), delete object(1m), remove object(1m), set object(1m), show object(1m)
list object(1m)