Sponsored Content
Top Forums Shell Programming and Scripting Execute commands to specific folder from input file Post 302423397 by clx on Friday 21st of May 2010 03:07:06 AM
Old 05-21-2010
Yes, I understood your intention and that's why I pointed that "*" MUST not be used to read the path from the file.
probably, you would have something different in your mind ( something like while read, since you used indirection). but missed that unintentionally.

I told that because I faced this couple of times with myself. Smilie
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Can Xargs execute multiple commands of evry input file

Hello , I am trying to print the footer of evry file in the given directory with xargs command like follows ls -1 | xargs -I {} gzcat {} | tail -1 now problem with this is only last file foooter is getting printed as " | tail -1 " is getting executed for the last file. I know this can... (4 Replies)
Discussion started by: nilesrex
4 Replies

2. Shell Programming and Scripting

Pls Help-Script to execute Commands and write to excel file

Execute some commands in script and store result in excel sheet Kindly help me........... (1 Reply)
Discussion started by: Computer_baby
1 Replies

3. UNIX for Advanced & Expert Users

Execute All Commands in A contrl File

Hi , I have a situation i need to write a while loop until the end of control file.In the control file i have a 5 lines which contains commands.how can i execute all with out waiting for the first one to complete. Ex ControlFile: ScripitName Test ScriptName Test1 ScriptName Test2 ... (1 Reply)
Discussion started by: ukatru
1 Replies

4. Shell Programming and Scripting

Reading specific contents from 1 input files and appending it to another input file

Hi guys, I am new to AWK and unix scripting. Please see below my problem and let me know if anyone you can help. I have 2 input files (example given below) Input file 2 is a standard file (it will not change) and we have to get the name (second column after comma) from it and append it... (5 Replies)
Discussion started by: sksahu
5 Replies

5. Shell Programming and Scripting

How to execute commands read from another file?

Please help with this simple example. I can not figure out how to do it. A file named “job” contains only this one line:var=5I need a script to read the job file and execute it as a command. This is my attempt (it does not work):#!/bin/sh exec < job echo "var = $var"output should read “var = 5”... (5 Replies)
Discussion started by: wolfv
5 Replies

6. Shell Programming and Scripting

How to copy specific file.txt in specific folder?

hye there... i have a problem to copy file in specific folder that will change the name according to host,time(%m%s) and date(%Y%M%D) example folder name: host_20100531.154101801 this folder name will always change... but i just want to copy the AAA.txt and BBB.txt file.. really need... (17 Replies)
Discussion started by: annetote
17 Replies

7. UNIX for Dummies Questions & Answers

Using any file in folder as command input

Hi all, I have a command I need to run on a large number of folders. It needs only one input, namely one of the 150 files in the folder (doesn't matter which one): command filenameThe problem is that the names of the files are random, so I was trying to just get the first file by using list and... (5 Replies)
Discussion started by: Linnnnn
5 Replies

8. Shell Programming and Scripting

Shell: How to execute commands from another file?

I made a configuration file for my shell script in that all the values that the shell scipt needs, are defined, but I don't know how to let the shell script use those defined variables. Thank you for your help :) (3 Replies)
Discussion started by: Alkali
3 Replies

9. Shell Programming and Scripting

How to take input from the user from the command line and execute commands basedon that?

Hi, I am using solaris 10 and bash shell.Script execution follows below.Initially it will check whether a directory exists or not if does not exist it will create it.(This I have completed) Second step:I have four users say user1,user2,user3,user4.Script should prompt for the user id and... (11 Replies)
Discussion started by: muraliinfy04
11 Replies

10. Shell Programming and Scripting

How to execute a batch file containing ftp commands??

hi, is there a way i can execute a batch file containing ftp commands like we execute sftp batch file. sftp -b batchfile user@server > output how to create a batch file for ftp executing command and how to run the batch file from a shell script? (2 Replies)
Discussion started by: Little
2 Replies
utime(3)						     Library Functions Manual							  utime(3)

Name
       utime - set file times

Syntax
       #include <sys/types.h>
       int utime (path, times)
       char *path;
       struct utimbuf *times;

Description
       The path points to a pathname naming a file.  The function sets the access and modification times of the named file.

       If  times  is  NULL, the access and modification times of the file are set to the current time.	A process must be the owner of the file or
       have write permission to use in this manner.

       If times is not NULL, times is interpreted as a pointer to a utimbuf structure and the access and modification times are set to the  values
       contained in the designated structure.  Only the owner of the file or the super-user can use this way.

       The function causes the time of the last file status change(st_ctime) to be updated with the current time.

       The times in the following structure are measured in seconds since 00:00:00 GMT, January 1, 1970.
       struct  utimbuf	{
	       time_t  actime;	  /* access time */
	       time_t  modtime;   /* modification time */
       };

Return Values
       Upon successful completion, a value of zero (0) is returned.  Otherwise, a value of -1 is returned, and errno is set to indicate the error.

Diagnostics
       The function fails, if any of the following is true:

       [EACCES]       Search permission is denied by a component of the path prefix.

       [EACCES]       The effective user ID is not super-user, not the owner of the file, times is NULL, and write access is denied.

       [EFAULT]       The times is not NULL and points outside the process's allocated address space.

       [EFAULT]       The path points outside the process's allocated address space.

       [ENOENT]       The named file does not exist or path points to an empty string and the environment defined is POSIX or SYSTEM_FIVE.

       [ENOTDIR]      A component of the path prefix is not a directory.

       [EPERM]	      The effective user ID is not a super-user, not the owner of the file, and times is not NULL.

       [EROFS]	      The file system containing the file is mounted read-only.

       [ETIMEDOUT]    A connect request or remote file operation failed, because the connected party did not respond after a period of time deter-
		      mined by the communications protocol.

See Also
       stat(2)

																	  utime(3)
All times are GMT -4. The time now is 11:08 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy