Sponsored Content
Top Forums Shell Programming and Scripting Script to go Into Directories and Find/Delete files Post 302789205 by gkelly1117 on Wednesday 3rd of April 2013 09:34:36 AM
Old 04-03-2013
My apologies, that makes sense, I have changed the title of the post to something more appropriate.

Also, I put comments in the code/query so people could understand my thought process, does it not come across as a clear thought?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Need script to find errored files inside directories

Hi people. I working on a script to check for files that they are suposed not to be on the directory. I mean, inside of each directory it must have some files but some could be wrong, and i want to move the files that are wrong. Ex: CSPOTGET edpst/CargadoresSPOT Historicos_Spot_MDI.zip... (4 Replies)
Discussion started by: osramos
4 Replies

2. Shell Programming and Scripting

Recursive call to find files and directories in Shell script from current path.

################################################################ Copy this script to your path from where you want to search for all the files and directories in subdirectories recursively. ################################################################# code starts here... (2 Replies)
Discussion started by: Ramit_Gupta
2 Replies

3. Red Hat

Find files older than 30 days in directories and delete them

Hi, I have dummies questions: My script here can find the files in any directories older than 30 days then it will delete the files but not the directories. I would like to also be able to delete the directories that hold old files more than 30 days not just the files itself. find . -type f... (2 Replies)
Discussion started by: lamoul
2 Replies

4. Shell Programming and Scripting

Script to find folders with spaces and end of files and directories

Hi I need a script that can search through a set of directories and can locate any file or directory that has a space at the end Filename(space) Foldername(space) I then need to remove that space within the script Hope someone can help thanks in advance Treds (8 Replies)
Discussion started by: treds
8 Replies

5. Shell Programming and Scripting

Find directories only and delete them created 3 days before

Hello I have some directories and files created under /export/local/user I would like to delete directories only under /export/local/user, created before 3 days Can someone help me with command to do this task? Thanks (4 Replies)
Discussion started by: needyourhelp10
4 Replies

6. Shell Programming and Scripting

Script to find files and delete it by comparing

I have a directory where lot of "gzip" files are dropped in every 5 minutes. There is an application which will process these gzip and move it to another directory but will leave a gzip.out file with lot of output data. I need to remove all the outfiles except for the one which is being... (1 Reply)
Discussion started by: gubbu
1 Replies

7. Homework & Coursework Questions

Find and delete empty files and directories

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Need to make a script, to remove all empty files and folders from current category. It also should show the name... (2 Replies)
Discussion started by: Itixop
2 Replies

8. UNIX for Dummies Questions & Answers

Script to find the files and delete them

This is a real world problem so I think you might found this interesting. We have servers which are shared by multiple team members. Each team member has its own user id and home directory. Now with time each user starts creating files which in end caused the disk to be full. Now for creating a... (5 Replies)
Discussion started by: Rohit06
5 Replies

9. Shell Programming and Scripting

Script to delete files with an input for directories and an input for path/file

Hello, I'm trying to figure out how best to approach this script, and I have very little experience, so I could use all the help I can get. :wall: I regularly need to delete files from many directories. A file with the same name may exist any number of times in different subdirectories.... (3 Replies)
Discussion started by: *ShadowCat*
3 Replies

10. Shell Programming and Scripting

Need shell script to compare directories and delete files on target server

Hello, I need help in writing the shell script for below mentioned case. There are 2 servers(server A, server B). A cronjob syncs files between these 2 servers. Existing script is copying files from A to B. This is done using the command rsync. However, the files are not deleted... (2 Replies)
Discussion started by: SravaniVedam11
2 Replies
SETPROCTITLE(3) 					   BSD Library Functions Manual 					   SETPROCTITLE(3)

NAME
setproctitle -- set process title LIBRARY
Utility functions from BSD systems (libbsd, -lbsd) SYNOPSIS
#include <sys/types.h> #include <bsd/unistd.h> void setproctitle(const char *fmt, ...); DESCRIPTION
The setproctitle() library routine sets the process title that appears on the ps(1) command. The title is set from the executable's name, followed by the result of a printf(3) style expansion of the arguments as specified by the fmt argument. If the fmt argument begins with a ``-'' character, the executable's name is skipped. If fmt is NULL, the process title is restored. EXAMPLES
To set the title on a daemon to indicate its activity: setproctitle("talking to %s", inet_ntoa(addr)); SEE ALSO
ps(1), w(1), kvm(3), kvm_getargv(3), printf(3) STANDARDS
The setproctitle() function is implicitly non-standard. Other methods of causing the ps(1) command line to change, including copying over the argv[0] string are also implicitly non-portable. It is preferable to use an operating system supplied setproctitle() if present. Unfortunately, it is possible that there are other calling conventions to other versions of setproctitle(), although none have been found by the author as yet. This is believed to be the predominant convention. It is thought that the implementation is compatible with other systems, including NetBSD and BSD/OS. HISTORY
The setproctitle() function first appeared in FreeBSD 2.2. Other operating systems have similar functions. AUTHORS
Peter Wemm <peter@FreeBSD.org> stole the idea from the Sendmail 8.7.3 source code by Eric Allman <eric@sendmail.org>. BUGS
Never pass a string with user-supplied data as a format without using '%s'. An attacker can put format specifiers in the string to mangle your stack, leading to a possible security hole. This holds true even if the string was built using a function like snprintf(), as the resulting string may still contain user-supplied conversion specifiers for later interpolation by setproctitle(). Always use the proper secure idiom: setproctitle("%s", string); BSD
December 16, 1995 BSD
All times are GMT -4. The time now is 01:09 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy