Sponsored Content
Top Forums Shell Programming and Scripting What is the function of the following lines at the top of a shell script file: Directory and Script? Post 302972321 by remytom on Wednesday 4th of May 2016 04:17:58 AM
Old 05-04-2016
Thank you!

Thank you for the quick reply. I have removed these lines from my code. But I see working scripts which have them. Its strange though, because I do get the error of command not found for these lines.

Thanks a lot!
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

extracting function headers in a c/c++ file using shell script

Hi, Is there any way to extract function headers from c and c++ files using a shell script? I tried to do it by reading the C/C++ file line by line and if a line matches a particular pattern (pattern of function header) i extracted it otherwise moved to next line. The problem here is, some... (3 Replies)
Discussion started by: priyadarshini
3 Replies

2. Shell Programming and Scripting

Calling a function in cpp file inside shell script

Hi I need to call a function written in a cpp file with arguments inside the shell script..Can anyone help me how to do this:( (1 Reply)
Discussion started by: rkrish
1 Replies

3. Homework & Coursework Questions

Shell Script - (file and directory)

The question is here: http://farm9.staticflickr.com/8065/8217767191_2154e64904_b.jpg My problem is that when I made up a non-existing directory, it prints out "hiii". It didn't enter the first if statement. It works if my directory exist. My Work: for fileOrDirectory in $* # all... (1 Reply)
Discussion started by: spider-man
1 Replies

4. Homework & Coursework Questions

Shell Script - (File and Directory)

1. The problem statement, all variables and given/known data: My problem is that when I made up a non-existing directory, it prints out "hiii". It didn't enter the first if statement. It works if my directory exist. 2. Relevant notes: The question is here:... (3 Replies)
Discussion started by: spider-man
3 Replies

5. UNIX for Dummies Questions & Answers

Shell script to read lines in a text file and filter user data Shell Programming and Scripting

sxsaaas (3 Replies)
Discussion started by: VikrantD
3 Replies

6. Shell Programming and Scripting

Shell scripting-I need a script which should watch a directory for a file with specific directory

I need a script which should watch a directory for a file with specific directory. If it finds a file in directory, it should search for few specific keyword in the file. if the keyword exists, it should trim string from specific column. The file should be moved to another directory and the a... (8 Replies)
Discussion started by: akashdeepak
8 Replies

7. Shell Programming and Scripting

Shell Script function to use script name for log file output

Hi Team - I"m very new to Shell Scripting so I have a rather novice question. My forte is Windows Batch Scripting so I was just wondering what the Shell Script equivalent is to the DOS command %~n? %~n is a DOS variable that dispayed the script name. For instance (in DOS): REM... (11 Replies)
Discussion started by: SIMMS7400
11 Replies

8. Shell Programming and Scripting

Script to search every file in a directory and print last few lines

Hi everyone, I need to write a script to search a directory, output the name of a file to an ouput file and print the last few lines of the files to the output file such that I would have something like this: FILE1: LINE LINE LINE FILE2: LINE LINE LINE FILE3: LINE LINE LINE... (2 Replies)
Discussion started by: mojoman
2 Replies

9. Shell Programming and Scripting

Shell script cannot create directory and move the file to that directory

I have a script, which is checking if file exists and move it to another directory if then mkdir -p ${LOCL_FILES_DIR}/cool_${Today}/monthly mv report_manual_alloc_rpt_A_I_ASSIGNMENT.${Today}*.csv ${LOCL_FILES_DIR}/cool_${Today}/monthly ... (9 Replies)
Discussion started by: digioleg54
9 Replies

10. Shell Programming and Scripting

Shell script to pass the config file lines as variable on the respective called function on a script

I want to make a config file which contain all the paths. i want to read the config file line by line and pass as an argument on my below function. Replace all the path with reading config path line by line and pass in respective functions. how can i achieve that? Kindly guide. ... (6 Replies)
Discussion started by: sadique.manzar
6 Replies
unifdef(1)							   User Commands							unifdef(1)

NAME
unifdef - resolve and remove ifdef'ed lines from C program source SYNOPSIS
unifdef [-clt] [-Dname] [-Uname] [-iDname] [-iUname] ... [filename] DESCRIPTION
unifdef removes ifdefed lines from a file while otherwise leaving the file alone. It is smart enough to deal with the nested ifdefs, com- ments, single and double quotes of C syntax, but it does not do any including or interpretation of macros. Neither does it strip out com- ments, though it recognizes and ignores them. You specify which symbols you want defined with -D options, and which you want undefined with -U options. Lines within those ifdefs will be copied to the output, or removed, as appropriate. Any ifdef, ifndef, else, and endif lines associated with filename will also be removed. ifdefs involving symbols you do not specify are untouched and copied out along with their associated ifdef, else, and endiff1 lines. If an ifdefX occurs nested inside another ifdefX, then the inside ifdef is treated as if it were an unrecognized symbol. If the same symbol appears in more than one argument, only the first occurrence is significant. unifdef copies its output to the standard output and will take its input from the standard input if no filename argument is given. OPTIONS
The following options are supported: -c Complement the normal operation. Lines that would have been removed or blanked are retained, and vice versa. -l Replace ``lines removed'' lines with blank lines. -t Plain text option. unifdef refrains from attempting to recognize comments and single and double quotes. -Dname Lines associated with the defined symbol name. -Uname Lines associated with the undefined symbol name. -iDname Ignore, but print out, lines associated with the defined symbol name. If you use ifdefs to delimit non-C lines, such as comments or code which is under construction, then you must tell unifdef which symbols are used for that purpose so that it will not try to parse for quotes and comments within them. -iUname Ignore, but print out, lines associated with the undefined symbol name. EXIT STATUS
The following exit values are returned: 0 Successful operation. 1 Operation failed. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWbtool | +-----------------------------+-----------------------------+ SEE ALSO
diff(1), attributes(5) DIAGNOSTICS
Premature EOF Inappropriate else or endif. SunOS 5.10 14 Jan 1992 unifdef(1)
All times are GMT -4. The time now is 11:42 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy