Assistance with shell script to check file type and move to a folder.
Hi,
Below is some code that I would like to implement however I am getting these errors: (what I am attempting to do is to check if a zip file has ascii files and if ascii and not binary then move the ascii files to a folder. some of the files are in xml format but are ascii and i will be moving those to xml folder.)
./dir1_zipchk.sh: line 26: ./G2007696.260_100607134807: Permission denied
./dir1_zipchk.sh: line 27: =: command not found
./dir1_zipchk.sh: line 30: =: command not found
no files
code:
Please use code tags.
Last edited by jim mcnamara; 09-20-2010 at 11:39 AM..
Reason: add code tags
Hi friends..
I hav a problem....
I dont know how to check .c files exists r not in a folder using IF in C shell script
actually i tried like this
if(=~ *.c)
even though some .c files or there in the current folder..it is not entering int o the if control statement...... (17 Replies)
This is the file structure:
DESKTOP/Root of Photo Folders/Folder1qweqwasdfsd/*jpg
DESKTOP/Root of Photo Folders/Folder2asdasdasd/*jpg
DESKTOP/Root of Photo Folders/Folder3asdadfhgasdf/*jpg
DESKTOP/Root of Photo Folders/Folder4qwetwdfsdfg/*jpg
DESKTOP/Root of Photo... (4 Replies)
Dear Experts,
I need to connect to a FTPS Server and move the files from FTPS folder "/SAP/Out" to Unix directory "/SAP/In". I need to run this script on Unix directory...Script should get the files from FTPS folder and place that in specified Unix Directory.
Thanks In Advance. (1 Reply)
Hi All,
I need to execute a SQL via shell script and i am connecting to Oracle DB by this way $USERNAME1/$PASSWORD1@$STRING1 and i need to get username, password and string from someother file stored in the Unix Directory. $Username, $Password and $String is stored in File A in Path A and i want... (1 Reply)
Hi all,
let me explain my requirments
i am having 5 folder with different name for eg) abc , cdf , efd, rtg, ead
each 5 folders contain 15 files
i want to move 10 files to some other folder, remain 5 files should be there in the same folder.
give me some suggestion on this. (6 Replies)
Hi,
It will be great help if any of them can provide or tell which scripting is possible to write for checking folder exists or not in Windows server from Unix/Windows machine.
If folder doesn't exist then need to create the folder through script and copy the files.
It is on very... (1 Reply)
Hi,
I have a file with few values in it. I need script help to read file line by line and check:
1/if it's a file (with extension eg .java .css .jar etc )
or
2/if it's a file without extension and treat it as a directory and then check if the directory exists in working copy else create one... (6 Replies)
Hi All,
I have to requirement to write a shell script to move file from one folder (A) to another five folder (B,C,D,E,F) and destination folder should be blank. In not blank just skip.
This script will run as a scheduler every 2 minutes. It will check number of files in folder A and move 1 to... (9 Replies)
Hi All,
I am a beginner in this and trying to write a shell script in linux which will :
1. Ask for a file name and check if its exists.
2. If file exists only then it will ask for the new target folder, after entering target folder name it will check if it exists.
3. If target folder... (3 Replies)
Hi Team,
I am new to shell script and there is a requirement where files should be moved from Subfolder to parent folder.
Eg:
parent folder --> /Interface/data/test/IN
Sub folder -->/Interface/data/test/IN/Invoice20180607233338
Subfolder will be always with timestamp... (6 Replies)
Discussion started by: srivarun15
6 Replies
LEARN ABOUT CENTOS
contents
contents(4) File Formats contents(4)NAME
contents - list of files and associated packages
SYNOPSIS
/var/sadm/install/contents
DESCRIPTION
The file /var/sadm/install/contents is a source of information about the packages installed on the system. This file must never be edited
directly. Always use the package and patch commands (see SEE ALSO) to make changes to the contents file.
Each entry in the contents file is a single line. Fields in each entry are separated by a single space character.
Two major styles of entries exist, old style and new style. The following is the format of an old-style entry:
ftype class path package(s)
The following is the general format of a new-style entry:
path[=rpath] ftype class [ftype-optional-fields] package(s)
New-style entries differ for each ftype. The ftype designates the entry type, as specified in pkgmap(4). The format for new-style entries,
for each ftype, is as follows:
ftype s: path=rpath s class package
ftype l: path l class package
ftype d: path d class mode owner group package(s)
ftype b: path b class major minor mode owner group package
ftype c: path c class major minor mode owner group package
ftype f: path f class mode owner group size cksum modtime package
ftype x: path x class mode owner group package
ftype v: path v class mode owner group size cksum modtime package
ftype e: path e class mode owner group size cksum modtime package
A significant distinction between old- and new-style entries is that the former do not begin with a slash (/) character, while the latter
(new-style) always do. For example, the following are new-style entries:
d none /dev SUNWcsd
e passwd /etc/passwd SUNWcsr
The following are new-style entries:
/dev d none 0755 root sys SUNWcsr SUNWcsd
/etc/passwd e passwd 0644 root sys 580 48299 1077177419 SUNWcsr
The following are the descriptions of the fields in both old- and new-style entries.
path
The absolute path of the node being described. For ftype s (indicating a symbolic link) this is the indirect pointer (link) name.
rpath
The relative path to the real file or linked-to directory name.
ftype
A one-character field that indicates the entry type (see pkgmap(4)).
class
The installation class to which the file belongs (see pkgmap(4)).
package
The package associated with this entry. For ftype d (directory) more than one package can be present.
mode
The octal mode of the file (see pkgmap(4)).
owner
The owner of the file (see pkgmap(4)).
group
The group to which the file belongs (see pkgmap(4)).
major
The major device number (see pkgmap(4)).
minor
The minor device number (see pkgmap(4)).
size
The actual size of the file in bytes as reported by sum (see pkgmap(4)).
cksum
The checksum of the file contents (see pkgmap(4)).
modtime
The time of last modification (see pkgmap(4)).
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWcsr |
+-----------------------------+-----------------------------+
|Interface Stability |Unstable |
+-----------------------------+-----------------------------+
SEE ALSO patchadd(1M), pkgadd(1M), pkgadm(1M), pkgchk(1M), pkgmap(4), attributes(5)NOTES
As shown above, the interface stability of /var/sadm/install/contents is Unstable (see attributes(5)). It is common practice to use this
file in a read-only manner to determine which files belong to which packages installed on a system. While this file has been present for
many releases of the Solaris operating system, it might not be present in future releases. The fully supported way to obtain information
from the installed package database is through pkgchk(1M). It is highly recommended that you use pkgchk rather than relying on the contents
file.
SunOS 5.10 29 Jun 2004 contents(4)