Sponsored Content
Top Forums Shell Programming and Scripting running a looping script for all files in directory Post 302233468 by labrazil on Sunday 7th of September 2008 08:38:26 PM
Old 09-07-2008
yes, that's the exact code, nothing more. I even tried changing the quotes from ' to `. Same error. And all the files are right in the same directory...
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

rm files in a directory, looping, counting, then exit

I am trying to write a script that will look for a file in a directory, then remove it. I need it to loop until it has removed a certain number of files. Is it better to do a repeat or to list each file in a pattern? Files will be numbered like RAF.01.*, RAF.02.*, etc. Thanks, James (6 Replies)
Discussion started by: JporterFDX
6 Replies

2. Shell Programming and Scripting

How to know the directory of the file containing the running script?

When you run a script, how will you know the directory for the actual file that contains the script. The code should be like .Me in VB. I dont know how we do it in unix. Is it possible? (8 Replies)
Discussion started by: alestoquia
8 Replies

3. Solaris

running script in any directory

hi im a cobol programmer but im new in unix. I just want to know how can i run script even if it is in other directory?? Thanks, (1 Reply)
Discussion started by: shinjeck
1 Replies

4. Shell Programming and Scripting

merge two files via looping script

Hi all, I hope you can help me. I got a file a and a file b File a contains a b c d e f g h File b contains 1 2 3 (8 Replies)
Discussion started by: stinkefisch
8 Replies

5. Shell Programming and Scripting

Help Looping through files in Vi Script

I am trying to write a script that loops through all the files in the current directory that end in '.slg.gz' and runs a parser on each file. Here is my code: #!/bin/bash FILES_HOME = 'dirname $0' for i in $(ls $FILES_HOME/.slg.gz$);do ./run-feature-parser $(i) > OUTPUT.csv done ... (1 Reply)
Discussion started by: kssteig
1 Replies

6. Shell Programming and Scripting

Rename folder/directory after running sort script

Hello, I'm trying to create a script that sorts documents by author (found in file name) and then create a directory for that author. For example, Input: John - Paper_1.txt John - Paper_2.txt Mark - Paper_1.txt Jill - Paper_1.txt Output: dir/John/Paper_1.txt dir/John/Paper_2.txt... (1 Reply)
Discussion started by: jl487
1 Replies

7. Shell Programming and Scripting

ksh script not running in another directory on same server

I have a script that runs fine under my home directory. No syntax errors, runs and returns as expected. When I migrate the script to the UAT directories on the same server for User testing, I get a syntax error. I've checked to make sure the .profile I'm using is the same in the UAT... (1 Reply)
Discussion started by: mpflug
1 Replies

8. Shell Programming and Scripting

Running shell script from any directory

Greetings all, We have an older environment that we are trying to bring up to par with our current Production and Test servers. We have a command on our production boxes, UniqueScriptName.sh, and we can issue that command from any directory and it works. On our older environment, our... (1 Reply)
Discussion started by: jeffs42885
1 Replies

9. Shell Programming and Scripting

Looping to check the currently running process.

Hi Gurus, t=`ps -u irb|grep -v grep|grep BSNL_PAYMENT_C` echo $t if then echo $? echo "Process Creation is Running ...." else echo "Process went down at $dat $tim" fi How would i use loop so that the script continously checks for the current status of this process.... (1 Reply)
Discussion started by: ankitknit
1 Replies

10. Shell Programming and Scripting

Running script in crontab in a specific directory

I am trying to run a script from crontab but the entire script (which is 70+ lines) is written in bash and I need it to run from a certain directory. So when I run it manually I cd to /local/mnt/scr and then type ./reordersc and it works fine. However, I want it to run from the crontab and I... (20 Replies)
Discussion started by: newbie2010
20 Replies
setfiles(8)															       setfiles(8)

NAME
setfiles - set file SELinux security contexts. SYNOPSIS
setfiles [-c policy ] [-d] [-l] [-n] [-e directory ] [-o filename ] [-q] [-s] [-v] [-vv|-p] [-W] [-F] spec_file pathname... DESCRIPTION
This manual page describes the setfiles program. This program is primarily used to initialize the security context database (extended attributes) on one or more filesystems. This program is initially run as part of the SE Linux installation process. It can also be run at any time to correct errors, to add support for new policy, or with the -n option it can just check whether the file contexts are all as you expect. It is the same executable as setfiles but operates in a slightly different manner depending on it's argv[0]. OPTIONS
-c check the validity of the contexts against the specified binary policy. -d show what specification matched each file. -l log changes in file labels to syslog. -n don't change any file labels. -p show progress by printing * every 1000 files. -q suppress non-error output. -r rootpath use an alternate root path -e directory directory to exclude (repeat option for more than one directory.) -F Force reset of context to match file_context for customizable files -o filename save list of files with incorrect context in filename. -s take a list of files from standard input instead of using a pathname on the command line. -v show changes in file labels, if type or role are changing. -vv show changes in file labels, if type, role, or user are changing. -p show a progress indication in the form of one dot per 1000 files. -W display warnings about entries that had no matching files. -0 Input items are terminated by a null character instead of by whitespace, and the quotes and backslash are not special (every char- acter is taken literally). Disables the end of file string, which is treated like any other argument. Useful when input items might contain white space, quote marks, or backslashes.The GNU find -print0 option produces input suitable for this mode. ARGUMENTS
spec_file The specification file which contains lines of the following form regexp [ -type ] ( context | <<none>> ) The regular expression is anchored at both ends. The optional type field specifies the file type as shown in the mode field by the ls(1) program, e.g. -- to match only regular files or -d to match only directories. The context can be an ordinary security context or the string <<none>> to specify that the file is not to have its context changed. The last matching specification is used. If there are multiple hard links to a file that match different specifications and those specifi- cations indicate different security contexts, then a warning is displayed but the file is still labeled based on the last matching specifi- cation other than <<none>>. pathname... The pathname for the root directory of each file system to be relabeled. Not used if the -s option is used. AUTHOR
This man page was written by Russell Coker <russell@coker.com.au>. The program was written by Stephen Smalley <sds@epoch.ncsc.mil> SEE ALSO
load_policy(8), checkpolicy(8) 2002031409 setfiles(8)
All times are GMT -4. The time now is 08:56 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy