Sponsored Content
Top Forums Shell Programming and Scripting How does calling it .sh help? Post 302808721 by Yoda on Friday 17th of May 2013 11:20:33 AM
Old 05-17-2013
Windows operating system which mostly require file name extensions for applications/utilities to function properly.

Linux and Unix-like operating systems does not require file name extensions and it doesn't make any difference.

As cero mentioned it is used for easily identifying the file type.

You can run the file command to determine file type.

There are three sets of tests, performed in this order: filesystem tests, magic number tests, and language tests to classify the file.

Check the man page for further reference:
Code:
man file

 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Calling a script from another

Hi, I have 2 scripts, one is the .profile and the other is a SID selector for Oracle Databases. But when I call one from the other, even though it seems to have worked, it doesn't. Can anyone help?? ******************* .profile********************** #!/bin/ksh .... (5 Replies)
Discussion started by: dnkansah
5 Replies

2. Cybersecurity

i am trying to find out who is calling me

they are having an operator call my home line and also my cell number and they are typing and the operator tells me what they are typing on their computer. i nevere heard of this. it is new to me. it is free the operator said, they knew my name and also a friend of mine's name...the phone says the... (2 Replies)
Discussion started by: gail
2 Replies

3. Shell Programming and Scripting

Get Calling File

OK, I'm very new to shell scripting, and I'm trying to write a (very) simple wrapper for sendmail that outputs all the arguments as well as the file that called sendmail to an output file which can later be looked over. Is it possible to get a file's name and path that called a script? (0 Replies)
Discussion started by: ghstber
0 Replies

4. UNIX for Dummies Questions & Answers

Calling a function

I have created a file generic.func and it has lots of functions. One of the functions is this: Check_backup_size() { dsmc q b $BACKUP_DIR/"*.Z" | awk '{print $1}'|sed 's///g' > outputfile X=`awk '{sum += $1} END {print sum }' outputfile'` echo "$X" ls -ltr $BACKUP_DIR/"*.Z" | awk... (5 Replies)
Discussion started by: ashika
5 Replies

5. Shell Programming and Scripting

calling script

Hi all, The scenario is: 1. I created a script called hello 2. i created another script called blah which meant to use "hello" script. How do i do it? e.g. "blah" script #!/bin/sh test = /home/blah/hello echo "please enter name" read name test $name is it correct ? or i... (2 Replies)
Discussion started by: c00kie88
2 Replies

6. UNIX for Dummies Questions & Answers

Calling alias

I have created a shortcut for the file kill_process.sh as shown below. alias kill_process="sh /root/kill_process.sh" It is working as per my expectations. But I have 2 questions. 1) Is there any better way? 2) How do I check what does kill_process link to? (1 Reply)
Discussion started by: shantanuo
1 Replies

7. UNIX for Dummies Questions & Answers

help with calling programs

Hi. I have a problem in running a program in linux system. This program (damaver.l86) is in the path /home/shenk/damaver/, and it needs to call another program (supcomb.l86) in another path /home/shenk/supcomb/. I tried to modified the .bash_profile, but it didn't work. The error message is always... (1 Reply)
Discussion started by: shenk
1 Replies

8. Programming

calling java from c++

I have an adapter written in c++ from which I need to call a java service point. Could anybody please provide an example program of calling java from c++ thanks in advance. (0 Replies)
Discussion started by: axes
0 Replies

9. Programming

Calling template at once

Hello Again, I am just wanted to know if we can call the Template using "require_once" at PHP? Any views around happy to discuss. Thanks in Advance (2 Replies)
Discussion started by: AimyThomas
2 Replies

10. Shell Programming and Scripting

Calling two function

Hi, I need to run start_load function for two tables. Step 1: if HMAX_TBL_ID and GMAX_TBLI_D are same for tab_name1 then echo message "all table ids are processed" Step 2: go back and call start_load for tab_name2 and check if table id are same for table 2 too. Please let me know how to... (5 Replies)
Discussion started by: sandy162
5 Replies
file(1) 							   User Commands							   file(1)

NAME
file - determine file type SYNOPSIS
/usr/bin/file [-dh] [-m mfile] [-M Mfile] [-f ffile] file... /usr/bin/file [-dh] [-m mfile] [-M Mfile] -f ffile /usr/bin/file -i [-h] [-f ffile] file... /usr/bin/file -i [-h] -f ffile /usr/bin/file -c [-d] [-m mfile] [-M Mfile] /usr/xpg4/bin/file [-dh] [-m mfile] [-M Mfile] [-f ffile] file... /usr/xpg4/bin/file [-dh] [-m mfile] [-M Mfile] -f ffile /usr/xpg4/bin/file -i [-h] [-f ffile] file... /usr/xpg4/bin/file -i [-h] -f ffile /usr/xpg4/bin/file -c [-d] [-m mfile] [-M Mfile] DESCRIPTION
The file utility performs a series of tests on each file supplied by file and, optionally, on each file listed in ffile in an attempt to classify it. If the file is not a regular file, its file type is identified. The file types directory, FIFO, block special, and character special are identified as such. If the file is a regular file and the file is zero-length, it is identified as an empty file. If file appears to be a text file, file examines the first 512 bytes and tries to determine its programming language. If file is a symbolic link, by default the link is followed and file tests the file to which the symbolic link refers. If file is a relocatable object, executable, or shared object, file prints out information about the file's execution requirements. This information includes the machine class, byte-ordering, static/dynamic linkage, and any software or hardware capability requirements. If file is a runtime linking configuration file, file prints information about the target platform, including the machine class and byte- ordering. By default, file will try to use the localized magic file /usr/lib/locale/locale/LC_MESSAGES/magic, if it exists, to identify files that have a magic number. For example, in the Japanese locale, file will try to use /usr/lib/locale/ja/LC_MESSAGES/magic. If a localized magic file does not exist, file will utilize /etc/magic. A magic number is a numeric or string constant that indicates the file type. See magic(4) for an explanation of the format of /etc/magic. If file does not exist, cannot be read, or its file status could not be determined, it is not considered an error that affects the exit status. The output will indicate that the file was processed, but that its type could not be determined. OPTIONS
The following options are supported: -c Checks the magic file for format errors. For reasons of efficiency, this validation is normally not carried out. -d Applies any position-sensitive and context-sensitive default system tests to the file. -f ffile ffile contains a list of the files to be examined. -h When a symbolic link is encountered, this option identifies the file as a symbolic link. If -h is not specified and file is a symbolic link that refers to a non-existent file, the file utility identifies the file as a symbolic link, as if -h had been specified. -i If a file is a regular file, this option does not attempt to classify the type of file further, but identifies the file as a "regular file". -m mfile /usr/bin/file Uses mfile as an alternate magic file, instead of /etc/magic. /usr/xpg4/bin/file Specifies the name of a file containing position-sensitive tests that are applied to a file in order to classify it (see magic(4)). If the -m option is specified without specifying the -d option or the -M option, position-sensitive default system tests are applied after the position-sensitive tests specified by the -m option. -M Mfile Specifies the name of a file containing position-sensitive tests that are applied to a file in order to classify it (see magic(4)). No position-sensitive default system tests nor context-sensitive default system tests are applied unless the -d option is also specified. If the -M option is specified with the -d option, the -m option, or both, or if the -m option is specified with the -d option, the concate- nation of the position-sensitive tests specified by these options is applied in the order specified by the appearance of these options. OPERANDS
The following operands are supported: file A path name of a file to be tested. USAGE
See largefile(5) for the description of the behavior of file when encountering files greater than or equal to 2 Gbyte ( 2^31 bytes). EXAMPLES
Example 1 Determining if an Argument is a Binary Executable Files The following example determine if an argument is a binary executable file: file "$1" | grep -Fq executable && printf "%s is executable.0 "$1" ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of file: LANG, LC_ALL, LC_CTYPE, LC_MES- SAGES, and NLSPATH. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/etc/magic file's magic number file ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWcsu | +-----------------------------+-----------------------------+ |CSI |Enabled | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
crle(1), elfdump(1), ls(1), magic(4), attributes(5), environ(5), largefile(5), standards(5) SunOS 5.11 15 May 2006 file(1)
All times are GMT -4. The time now is 04:33 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy