05-30-2006
I hadn't really thought about portability...
Thanks for pointing that out.
I hadn't really thought about portability, but I am going to try be more "portably" correct.
In terms of portability, I am assuming that the posix definition should be fairly portable, so I will pay the most attention to that.
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
Hi,
I would like to list latest 2 days, 3 days or 4 days,etc of files in the directory...
how? is it using ls? (3 Replies)
Discussion started by: happyv
3 Replies
2. Shell Programming and Scripting
i want to make a bash script that searches a specific pattern in files through all subdirectories beneath the current directory..without using the command grep-R
but only the command grep..
e.g
for i in *
do
grep "pattern" $i
.....
...
done
using the character (*) the script... (5 Replies)
Discussion started by: milagros
5 Replies
3. Shell Programming and Scripting
Hi
I was wondering why command 2 doesn't work like command 1 below.
1.
find . -exec grep "test" '{}' \; -print
2.
ls -R | grep "test"
I am trying to search "test" from all the files in the current and sub directories. What's wrong with my command 2?
Thanks in advance for your help (4 Replies)
Discussion started by: tiger99
4 Replies
4. Shell Programming and Scripting
Hi All
I was wondering what is the most efficient way to find files in the current directory(that may contain 100,000's files), that meets a certain specified file type and of a certain age.
I have experimented with the find command in unix but it also searches all sub directories. I have... (2 Replies)
Discussion started by: kewong007
2 Replies
5. Shell Programming and Scripting
Hello,
Using the instruction mget (within ftp) and with "Interactive mode off", I want to get all files from directory (DirAA), but not the files in sub-directories.
The files names don't follow any defined rule, so they can be just letters without (.) period
Directory structure example: ... (0 Replies)
Discussion started by: Peter321
0 Replies
6. Shell Programming and Scripting
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)
Discussion started by: bisip99
4 Replies
7. UNIX for Dummies Questions & Answers
Hi All,
Request your expertise in tackling one requirement in my project,(i dont have much expertise in Shell Scripting). The requirement is as below,
1) We store the last run date of a process in a file. When the batch run the next time, it should read this file, get the last run date from... (1 Reply)
Discussion started by: dsfreddie
1 Replies
8. Shell Programming and Scripting
I have a Solaris System. I am using bash shell.
I want to prepare a script which can do the below.
There are few directories i need to clean.
In those directories, I need to delete files which are older than 3 days. 3 days before files need to be deleted.
The directories are as follows.... (7 Replies)
Discussion started by: Saidul
7 Replies
9. UNIX for Advanced & Expert Users
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Discussion started by: ksailesh1
7 Replies
10. UNIX for Beginners Questions & Answers
Hi All,
I've been trying to do some recursive searching but not been very successful. Can someone please help.
Scenario:
I have directory structure
/dir1/dir2/dir3/
2019/
11/
17
18
19
20
so what I want to do is run a script and as its 2019/11/18/ today it would go and only search... (3 Replies)
Discussion started by: israr75
3 Replies
LEARN ABOUT NETBSD
pathchk
PATHCHK(1) BSD General Commands Manual PATHCHK(1)
NAME
pathchk -- check pathnames
SYNOPSIS
pathchk [-p] pathname ...
DESCRIPTION
The pathchk utility checks whether each of the specified pathname arguments is valid or portable.
A diagnostic message is written for each argument that:
o Is longer than PATH_MAX bytes.
o Contains any component longer than NAME_MAX bytes. (The value of NAME_MAX depends on the underlying file system.)
o Contains a directory component that is not searchable.
It is not considered an error if a pathname argument contains a nonexistent component as long as a component by that name could be created.
The options are as follows:
-p Perform portability checks on the specified pathname arguments. Diagnostic messages will be written for each argument that:
o Is longer than _POSIX_PATH_MAX (255) bytes.
o Contains a component longer than _POSIX_NAME_MAX (14) bytes.
o Contains any character not in the portable filename character set (that is, alphanumeric characters, '.', '-' and '_'). No com-
ponent may start with the hyphen ('-') character.
EXAMPLES
Check whether the names of files in the current directory are portable to other POSIX systems:
find . -exec pathchk -p {} +
or the more efficient:
find . -print0 | xargs -0 pathchk -p
SEE ALSO
getconf(1), pathconf(2), stat(2)
STANDARDS
The pathchk utility conforms to IEEE Std 1003.1-2001 (``POSIX.1'').
HISTORY
A pathchk utility appeared in NetBSD 2.0.
BSD
November 9, 2010 BSD