Try:
I use the Korn shell. You can use any POSIX conforming shell by changing /bin/ksh in #!/bin/ksh to the pathname of the conforming shell you want to use. (And, remove the echo, when you have convinced yourself that the script correctly selects the files you want to move.)
Last edited by fpmurphy; 12-22-2012 at 11:07 AM..
This User Gave Thanks to Don Cragun For This Post:
I tried it to a sample hidden file, but the for loop doesnt identify the hidden file at all. I get the following when i run it:
Following are the files in the directory
I want the above two hidden files to be converted to unhidden so that i can move them to another directory as unhidden.
I have your script like the following:
Please help.
Last edited by Scott; 12-22-2012 at 09:40 AM..
Reason: Please use code tags
I tried it to a sample hidden file, but the for loop doesnt identify the hidden file at all. I get the following when i run it:
Following are the files in the directory
I want the above two hidden files to be converted to unhidden so that i can move them to another directory as unhidden.
I have your script like the following:
Please help.
I note that you left out the #!/bin/ksh line that I had in the script I gave you.
In my test directory, where the output from the command:
is:
the output from my script running on OS X is:
I'm glad that bipinajith's script worked for you, but I'd still like to know why ksh or bash on AIX didn't work for you. What shell did you use? What happens if you run the command:
instead of:
Note that ~/mvhidden runs a command found in your home directory; did you by any chance have different versions of mvhidden in different directories?
Hello.
I use this command :
rsync -av --include=".*" --dry-run "$A_FULL_PATH_S" "$A_FULL_PATH_D"The data comes from the output of a find command.
And no full source directories are in use, only some files.
Source example... (2 Replies)
Find all files in the current directory only excluding hidden directories and files.
For the below command, though it's not deleting hidden files.. it is traversing through the hidden directories and listing normal which should be avoided.
`find . \( ! -name ".*" -prune \) -mtime +${n_days}... (7 Replies)
Hi guys can you please help me with a script to find files with one row/1 line of content then move the file to another directory my script below runs but nothing happens to the files....Alternatively Ca I get a script to find the *.csv files with "wc -1" results = 1 then create a list of those... (5 Replies)
I am running a code like this
foreach list ($tmp)
mv *_${list}.txt ${chart}_${list}.txt #mv: when moving multiple files, last argument must be a directory
mv *_${list}.doc ${chart}_${list}.doc #mv: when moving multiple files, last argument must be a... (3 Replies)
HI All,
I am coding a shell script which will pick all the .csv files in a particular directoryand write it in to a .txt file, this .txt file i will use as a source in datastage for processing.
now after the processing is done I have to move and archive all the files in the .txt file to a... (5 Replies)
I usually use ls -al | awk '{sum = sum + $5} END {print sum}' to sum the size of all files in a directory. However this command includes the hidden files.
Is there a command to just add up all the files/sub-directories excluding the hidden files (begins with . and ..)
I wanted to check the... (10 Replies)
Hi. I have a script which is deleting files with a particular extension and older than 45 days.The code is:
find <path> -name "<filename_pattern>" -mtime +45 -exec rm {} \;
But the problem is that some important files are also getting deleted.To prevent this I have decide to make a dummy... (4 Replies)
Hello experts,
I run Solaris 9. I have a below script which is used for gunzip the thousand files from a directory.
----
#!/usr/bin/sh
cd /home/thousands/gzipfiles/
for i in `ls -1`
do
gunzip -c $i > /path/to/file/$i
done
----
In my SAME directory there thousand of GZIP file and also... (4 Replies)