Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Click here to start participating now! Also, check out the New User Guide.
script to update file timestamp
Name: vish Date: July 19, 2006 at 07:41:31 Pacific OS: sun os CPU/Ram: sun4u Product: ultra-60
Comment:
hi,
I am trying to write a unix script that recursively goes into each directory and 'touches' the file to update the time stamp.....any help on how to go about it is appreciated..
Name: nails Date: July 19, 2006 at 10:02:02 Pacific
Reply:
I'm not near a unix box, so this is:
# untested find /mydir -type f -print|while read myfile do touch myfile done
0
Response Number 2
Name: nails Date: July 19, 2006 at 15:59:16 Pacific
Reply:
Sorry, but I corrected a syntax error:
I'm not near a unix box, so this is: # untested find /mydir -type f -print|while read myfile do touch $myfile done
0
Response Number 3
Name: ghostdog Date: July 19, 2006 at 22:14:40 Pacific
Reply:
find /mydir -type f |xargs touch
0
Response Number 4
Name: vish Date: July 24, 2006 at 08:57:19 Pacific
Reply:
I am new to unix, I saved the file as test.sh and changed permissions using chmod 777 test.sh. When i try to run using ./test or test I keep getting the message "command not found"...wht am i doing wrong here?
0
Response Number 5
Name: nails Date: July 24, 2006 at 11:46:56 Pacific
Reply:
I'm guessing that the directory where script test.sh resides isn't in your PATH. If your current directory is the directory where test.sh resides and it still doesn't work, try this:
./test.sh
If you want unix to search your current directory, append a period to end of PATH:
PATH=$PATH:. export PATH
I must warn you about the security considerations of doing this - especially if you are the root user.
Summary: Would you please help me write a script to move file between dirs? I am new to unix. But I need this for my work. The script should check id and pw. thanks. ...
Summary: I am look for a shell script to scan all files in the system to find out if a file contains a particular string. If yes, then write the file name, path and line number containing the searching string ...
Summary: I want to write a csh script to search files "Scan_ddmmyy.csv" placed in a directory. The program should look for EXCLUSIVE flags in the 6th, 7th & 8th fields(0/1- Assume exclusive here for simplicity...