Sponsored Content
Top Forums UNIX for Dummies Questions & Answers chmod for files and directories Post 302300753 by kenkanya on Wednesday 25th of March 2009 02:00:18 AM
Old 03-25-2009
Thanks for your post.
To answer your question, Yes iam not passing any parameters.
Iam using the var as you mentioned.

I made some modifications and its working fine, perfect.
(The script i changed -
Code:
var1="insideragain"
var2="inside2.html"
if [ ! -d $var1 ];
then
echo $var1
echo "Directory not found"
  exit 1
  else
    if [ ! -f $var2 ]
       then
       chmod 444 $var1/inside2.html
    fi
#else
#echo "Directory not found"
fi)

One more question:
Is there any way to loop it. i mean

if <condition true>
then <do something>
elsif goto nextstep

In windows batch script i can use (In the below case if it does not satisfy i go to "nextstep" and it works from there)

if not <condition true> goto nextstep
then <do something>
endif
:nextstep
<whatever needs to be done here>

Thanks for your valuable input. It worked. I appreciate too.

Last edited by Yogesh Sawant; 03-25-2009 at 03:10 AM.. Reason: added code tags
 

9 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

chmod 777 on all directories below...how do I do that using the "find" command?

I've got 100 directories that each have 2 directories with in them. Structered like this: /home/domains/domain1/ through to /home/domains/domain100/ and those 2 directories mentioned above are here: /home/domains/domain1/directory1/ /home/domains/domain1/directory2/ through to... (7 Replies)
Discussion started by: Neko
7 Replies

2. UNIX for Advanced & Expert Users

recursive chmod that only affects directories?

The man page for chmod doesn't list a way to recursively change permissions on directories only, without affecting the files themselves. Let's say that I wanted to change the permissions on the current directory and all subdirectories. I know I can write a bash script that would do this using... (1 Reply)
Discussion started by: retrovertigo
1 Replies

3. Shell Programming and Scripting

help with chmod (files only)

hello, i want to chmod 444 all files in a directory, files in subdirs cannot be chmoded same goes for the subdirs themself. So using: chmod -R 444 /dir/ won't work because it will chmod the directorys and files (together with files in subdirectorys) I figured out how to chmod files... (1 Reply)
Discussion started by: TehOne
1 Replies

4. UNIX for Advanced & Expert Users

chmod to parent and sub directories ?

Hi folk, Could you please give me command to give the rwx permissions to the parent and its sub directories ? Is it possible to fire one command or Script for giving permission to both the parent and its sub directories. I meant to say something like in recurcive. I am using AIX 5.2 ... (2 Replies)
Discussion started by: varungupta
2 Replies

5. UNIX and Linux Applications

What is the difference between chmod in solaris and chmod in Linux?

i think it is the same in both... Iam i right? (1 Reply)
Discussion started by: sumaiya
1 Replies

6. UNIX for Dummies Questions & Answers

List directories and sub directories recursively excluding files

Hi, Please help me, how to get all the direcotries, its sub directories and its sub directories recursively, need to exclude all the files in the process. I wanted to disply using a unix command all the directories recursively excluding files. I tried 'ls -FR' but that display files as... (3 Replies)
Discussion started by: pointers
3 Replies

7. UNIX for Dummies Questions & Answers

Change chmod on files in diff directories

I am looking for a small script to crawl through several directories and change a couple of files in each directory to read write status. Anyone have any ideas ? (5 Replies)
Discussion started by: zapper222
5 Replies

8. Shell Programming and Scripting

How to list all the files, directories and sub-directories in the current path except one directory?

Can anyone come up with a unix command that lists all the files, directories and sub-directories in the current directory except a folder called log.? Thank you in advance. (7 Replies)
Discussion started by: Manjunath B
7 Replies

9. Shell Programming and Scripting

Archiving and moving files into directories, creating directories, etc.

how can i move "dataName".sql.gz into a folder called 'database' and then move "$fileName".tar.gz * .htaccess into a folder called 'www' with the entire gzipped file being "$fileName".tar.gz? Is this doable or overly complex. so mydemo--2015-03-23-1500.tar.gz > database -... (5 Replies)
Discussion started by: wyclef
5 Replies
QAxScript(3qt)															    QAxScript(3qt)

NAME
QAxScript - Wrapper around script code SYNOPSIS
This class is part of the Qt ActiveQt Extension. #include <qaxscript.h> Inherits QObject. Public Members enum FunctionFlags { FunctionNames = 0, FunctionSignatures } QAxScript ( const QString & name, QAxScriptManager * manager ) ~QAxScript () bool load ( const QString & code, const QString & language = QString::null ) QStringList functions ( FunctionFlags flags = FunctionNames ) const QString scriptCode () const QString scriptName () const QAxScriptEngine * scriptEngine () const QVariant call ( const QString & function, const QVariant & var1 = QVariant ( ), const QVariant & var2 = QVariant ( ), const QVariant & var3 = QVariant ( ), const QVariant & var4 = QVariant ( ), const QVariant & var5 = QVariant ( ), const QVariant & var6 = QVariant ( ), const QVariant & var7 = QVariant ( ), const QVariant & var8 = QVariant ( ) ) QVariant call ( const QString & function, QValueList<QVariant> & arguments ) Signals void entered () void finished () void finished ( const QVariant & result ) void finished ( int code, const QString & source, const QString & description, const QString & help ) void stateChanged ( int state ) void error ( int code, const QString & description, int sourcePosition, const QString & sourceText ) DESCRIPTION
This class is defined in the Qt ActiveQt Extension, which can be found in the qt/extensions directory. It is not included in the main Qt API. The QAxScript class provides a wrapper around script code. Every instance of the QAxScript class represents a piece of scripting code in a particular scripting language. The code is loaded into the script engine using load(). Functions declared in the code can be called using call(). The script provides scriptEngine() provides feedback to the application through signals. The most important signal is the error() signal. Direct access to the QAxScriptEngine is provided through the scriptEngine() function. Warning: This class is not available with the bcc5.5 and MingW compilers. Member Type Documentation QAxScript::FunctionFlags This FunctionFlags enum describes formatting for function introspection. QAxScript::FunctionNames - Only function names are returned. QAxScript::FunctionSignatures - Returns the functions with signatures. MEMBER FUNCTION DOCUMENTATION
QAxScript::QAxScript ( const QString & name, QAxScriptManager * manager ) Constructs a QAxScript object called name and registers it with the QAxScriptManager manager. This is usually done by the QAxScriptManager class when loading a script. A script should always have a name. A manager is necessary to allow the script code to reference objects in the application. The manager takes ownership of the object. QAxScript::~QAxScript () Destroys the object, releasing all allocated resources. QVariant QAxScript::call ( const QString & function, const QVariant & var1 = QVariant ( ), const QVariant & var2 = QVariant ( ), const QVariant & var3 = QVariant ( ), const QVariant & var4 = QVariant ( ), const QVariant & var5 = QVariant ( ), const QVariant & var6 = QVariant ( ), const QVariant & var7 = QVariant ( ), const QVariant & var8 = QVariant ( ) ) Calls function, passing the parameters var1, var1, var2, var3, var4, var5, var6, var7 and var8 as arguments and returns the value returned by the function, or an invalid QVariant if the function does not return a value or when the function call failed. See QAxScriptManager::call() for more information about how to call script functions. QVariant QAxScript::call ( const QString & function, QValueList<QVariant> & arguments ) This is an overloaded member function, provided for convenience. It behaves essentially like the above function. Calls function passing arguments as parameters, and returns the result. Returns when the script's execution has finished. See QAxScriptManager::call() for more information about how to call script functions. void QAxScript::entered () [signal] This signal is emitted when a script engine has started executing code. void QAxScript::error ( int code, const QString & description, int sourcePosition, const QString & sourceText ) [signal] This signal is emitted when an execution error occured while running a script. code, description, sourcePosition and sourceText contain information about the execution error. void QAxScript::finished () [signal] This signal is emitted when a script engine has finished executing code. void QAxScript::finished ( const QVariant & result ) [signal] This is an overloaded member function, provided for convenience. It behaves essentially like the above function. result contains the script's result. This will be an invalid QVariant if the script has no return value. void QAxScript::finished ( int code, const QString & source, const QString & description, const QString & help ) [signal] This is an overloaded member function, provided for convenience. It behaves essentially like the above function. code, source, description and help contain exception information when the script terminated. QStringList QAxScript::functions ( FunctionFlags flags = FunctionNames ) const Returns a list of all the functions in this script if the respective script engine supports introspection; otherwise returns an empty list. The functions are either provided with full prototypes or only as names, depending on the value of flags. See also QAxScriptEngine::hasIntrospection(). bool QAxScript::load ( const QString & code, const QString & language = QString::null ) Loads the script source code written in language language into the script engine. Returns TRUE if code was successfully entered into the script engine; otherwise returns FALSE. If language is empty (the default) it will be determined heuristically. If code contains the string End Sub it will be interpreted as VBScript, otherwise as JScript. Additional scripting languages can be registered using QAxScript::registerEngine(). This function can only be called once for each QAxScript object, which is done automatically when using QAxScriptManager::load(). QString QAxScript::scriptCode () const Returns the script's code, or the null-string if no code has been loaded yet. See also load(). QAxScriptEngine * QAxScript::scriptEngine () const Returns a pointer to the script engine. You can use the object returned to connect signals to the script functions, or to access the script engine directly. QString QAxScript::scriptName () const Returns the name of the script. void QAxScript::stateChanged ( int state ) [signal] This signal is emitted when a script engine changes state. state can be any value in the QAxScriptEngineState enumeration. SEE ALSO
http://doc.trolltech.com/qaxscript.html http://www.trolltech.com/faq/tech.html COPYRIGHT
Copyright 1992-2007 Trolltech ASA, http://www.trolltech.com. See the license file included in the distribution for a complete license statement. AUTHOR
Generated automatically from the source code. BUGS
If you find a bug in Qt, please report it as described in http://doc.trolltech.com/bughowto.html. Good bug reports help us to help you. Thank you. The definitive Qt documentation is provided in HTML format; it is located at $QTDIR/doc/html and can be read using Qt Assistant or with a web browser. This man page is provided as a convenience for those users who prefer man pages, although this format is not officially supported by Trolltech. If you find errors in this manual page, please report them to qt-bugs@trolltech.com. Please include the name of the manual page (qaxscript.3qt) and the Qt version (3.3.8). Trolltech AS 2 February 2007 QAxScript(3qt)
All times are GMT -4. The time now is 06:27 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy