10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
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
2. Shell Programming and Scripting
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)
Discussion started by: ashish_neekhra
3 Replies
3. Shell Programming and Scripting
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)
Discussion started by: peekuabc
9 Replies
4. Shell Programming and Scripting
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)
Discussion started by: iaav
6 Replies
5. Shell Programming and Scripting
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)
Discussion started by: prakashchakra7
1 Replies
6. Shell Programming and Scripting
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)
Discussion started by: natraj005
6 Replies
7. UNIX for Dummies Questions & Answers
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)
Discussion started by: sathish.tn
1 Replies
8. Shell Programming and Scripting
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)
Discussion started by: phani333
1 Replies
9. Shell Programming and Scripting
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)
Discussion started by: guptaxpn
4 Replies
10. Shell Programming and Scripting
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)
Discussion started by: p.hemadrireddy
17 Replies
file(1B) SunOS/BSD Compatibility Package Commands file(1B)
NAME
file - determine the type of a file by examining its contents
SYNOPSIS
/usr/ucb/file [-f ffile] [-cL] [-m mfile] filename...
DESCRIPTION
file performs a series of tests on each filename in an attempt to determine what it contains. If the contents of a file appear to be
ASCII text, file examines the first 512 bytes and tries to guess its language.
file uses the file /etc/magic to identify files that have some sort of magic number, that is, any file containing a numeric or string con-
stant that indicates its type.
OPTIONS
-c Check for format errors in the magic number file. For reasons of efficiency, this validation is not normally carried out. No
file type-checking is done under -c.
-f ffile Get a list of filenames to identify from ffile.
-L If a file is a symbolic link, test the file the link references rather than the link itself.
-m mfile Use mfile as the name of an alternate magic number file.
EXAMPLES
Example 1 Using file on all the files in a specific user's directory.
This example illustrates the use of file on all the files in a specific user's directory:
example% pwd
/usr/blort/misc
example% /usr/ucb/file *
code: mc68020 demand paged executable
code.c: c program text
counts: ascii text
doc: roff,nroff, or eqn input text
empty.file: empty
libz: archive random library
memos: directory
project: symboliclink to /usr/project
script: executable shell script
titles: ascii text
s5.stuff: cpio archive
example%
ENVIRONMENT VARIABLES
The environment variables LC_CTYPE, LANG, and LC_default control the character classification throughout file. On entry to file, these
environment variables are checked in the following order: LC_CTYPE, LANG, and LC_default. When a valid value is found, remaining environ-
ment variables for character classification are ignored. For example, a new setting for LANG does not override the current valid character
classification rules of LC_CTYPE. When none of the values is valid, the shell character classification defaults to the POSIX.1 "C"
locale.
FILES
/etc/magic
ATTRIBUTES
See attributes(5) for descriptions of the following attributes:
+-----------------------------+-----------------------------+
| ATTRIBUTE TYPE | ATTRIBUTE VALUE |
+-----------------------------+-----------------------------+
|Availability |SUNWscpu |
+-----------------------------+-----------------------------+
SEE ALSO
magic(4), attributes(5)
BUGS
file often makes mistakes. In particular, it often suggests that command files are C programs.
file does not recognize Pascal or LISP.
SunOS 5.11 14 Sep 1992 file(1B)