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)						      General Commands Manual							unifdef(1)

NAME
unifdef - remove preprocessor lines SYNOPSIS
sym] sym] sym] sym]] ... [file] DESCRIPTION
simulates some of the actions of in interpreting C language preprocessor command lines (see cpp(1)). For a valid preprocessor command line contains as its first character a and one of the following keywords: or The character and its associated keyword must appear on the same line, but they can be separated by spaces, tabs, and commented text. When appropriate, the portions of code surrounded by and including the targeted preprocessor directives are removed, and the resultant text is written to the standard output. Unlike does not insert included files, interpret macros, or strip comment lines. This means, among other things, that and macros occurring within the input text are not interpreted. Since is language-independent, it can be used for processing source files for languages other than the C language. For example, can be used on FORTRAN language source files, provided the C language preprocessor commands are used. Options recognizes the following command-line options: Complement the normal behavior by printing only the rejected lines. Ignore text delimited by sym. In other words, text that would otherwise be affected by some action is not touched when found within the context of a preprocessor command using sym. Ignore text delimited by sym. Replace rejected lines with blank lines in the text written to the standard output. Treat the input source as plain text. C-language comment and quoting constructs are not recognized. Define symbol sym. Cause symbol sym to be undefined. RETURN VALUE
The command returns the following exit values: 0 Output is an exact copy of the input. 1 Output is not an exact copy of the input. 2 The command fails. The failure might be due to a premature EOF or to an inappropriate or EXAMPLES
Assume file contains the following: The command sequence: produces the following result in file WARNINGS
Any symbol name defined in the file must be specified in the command line; otherwise, will ignore the line. AUTHOR
was developed in the public domain. SEE ALSO
cpp(1). unifdef(1)
All times are GMT -4. The time now is 06:20 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy