Sponsored Content
Top Forums UNIX for Dummies Questions & Answers BASH Shell Scripting: If, Then Statement Post 302796053 by inkjoy00 on Thursday 18th of April 2013 09:00:54 PM
Old 04-18-2013
Sorry. I didn't fully write the code. It should delete all "/* */" in the file_name.c

Code:
#!/bin/bash

read "cat file" // User will input command cat file_name.c
if [ '$file == $file.c ]; // Must be a .c file
then
  sed '/*/,/\//d' 
else
 exit // Any other file won't change
fi

How come you chose to use case instead? Wouldn't an if, then statement work better?
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

bash shell scripting

Hi, i am new to UNIX. I have couple of basic questions. 1. Is the syntax for BASH shell programming same in the LINUX and SUN SOLARIS operating systems? 2. I have to work on BASH shell programming in SUN SOLARIS operating system. I am going through the documentation from the following... (4 Replies)
Discussion started by: azazalis
4 Replies

2. Shell Programming and Scripting

Help!! bash shell scripting..

Can any1 please help me... i'm really lost in using bash shell scripting... and i got to hand this up on monday... please anyone teach me how to do this assignment... Please use basic things because i just learn the program only... thanks ... (1 Reply)
Discussion started by: Fr0z3n999
1 Replies

3. Shell Programming and Scripting

Bash shell Scripting help

wwww wwwwwwww wwwwwwwwwwwww (0 Replies)
Discussion started by: keyvan
0 Replies

4. UNIX for Dummies Questions & Answers

korn shell to bash - statement not working

Everything else seems to be working, but this isn't. Is it the "cat..." that is wrong of the condition? Thanks. cat tc_result.txt | while read LINE do if then let "files_run += 1"; echo "inside the if loop" # save current filetype case $LINE... (5 Replies)
Discussion started by: brdholman
5 Replies

5. Shell Programming and Scripting

File handling with bash shell scripting

Hi all, Can anyone guide to get tricks for file handling in bash shell? Thanks in advance. Thanks Deepak (2 Replies)
Discussion started by: naw_deepak
2 Replies

6. Homework & Coursework Questions

Help with bash shell scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Write a bash shell script that takes as an argument a name. Then your script will ask the user for two numbers.... (15 Replies)
Discussion started by: boyboy1212
15 Replies

7. Shell Programming and Scripting

Bash shell scripting doubt

Hello All, I am setting up a cron job, where i am calling a shell script to make few builds. I got struck at a point, need some expert inputs to proceed further. The script is categorized in 5 parts and in the last part while building software it asks for few questions like:- 1. Build mode... (4 Replies)
Discussion started by: sahil_jammu
4 Replies

8. UNIX for Dummies Questions & Answers

Learn bash shell scripting

I do not know shell scripting. But at work place, I have got an in and out shell scripting task. I just need to understand a very big script. Is there any tool in which I can place the script and it can tell me the meaning of the whole script? (3 Replies)
Discussion started by: lg123
3 Replies

9. Shell Programming and Scripting

Generate sql statement using shell scripting

Can anyone please assist me? I have attached 2 input files and one output file. I need to generate the sql update statements using the above 2 input files. if inputfile2 has 5 rows, then we should generate 5 update statements because column1 is unique. inputfile1 and inputfile2 may contain more... (10 Replies)
Discussion started by: vinus
10 Replies

10. Shell Programming and Scripting

Shell scripting with case statement

Foe example we have three environments int,qa and prod.Each environment has some number of servers. int=Server1,Server2,Server3 qa=Server4,Server5,Server6 prod=Server7,Server8,Server9 echo "Enter the Environment i.e int,qa,prod" read env case $env in int) ## Need command where all the... (9 Replies)
Discussion started by: nareshreddy443
9 Replies
COMP_ERR(1)						       MySQL Database System						       COMP_ERR(1)

NAME
comp_err - compile MySQL error message file SYNOPSIS
comp_err [options] DESCRIPTION
comp_err creates the errmsg.sys file that is used by mysqld to determine the error messages to display for different error codes. comp_err normally is run automatically when MySQL is built. It compiles the errmsg.sys file from the plaintext file located at sql/share/errmsg.txt in MySQL source distributions. comp_err also generates mysqld_error.h, mysqld_ername.h, and sql_state.h header files. For more information about how error messages are defined, see the MySQL Internals Manual[1]. Invoke comp_err like this: shell> comp_err [options] comp_err supports the following options. o --help, -? Display a help message and exit. o --charset=path, -C path The character set directory. The default is ../sql/share/charsets. o --debug=debug_options, -# debug_options Write a debugging log. A typical debug_options string is d:t:O,file_name. The default is d:t:O,/tmp/comp_err.trace. o --debug-info, -T Print some debugging information when the program exits. o --header_file=file_name, -H file_name The name of the error header file. The default is mysqld_error.h. o --in_file=file_name, -F file_name The name of the input file. The default is ../sql/share/errmsg.txt. o --name_file=file_name, -N file_name The name of the error name file. The default is mysqld_ername.h. o --out_dir=path, -D path The name of the output base directory. The default is ../sql/share/. o --out_file=file_name, -O file_name The name of the output file. The default is errmsg.sys. o --statefile=file_name, -S file_name The name for the SQLSTATE header file. The default is sql_state.h. o --version, -V Display version information and exit. COPYRIGHT
Copyright (C) 1997, 2014, Oracle and/or its affiliates. All rights reserved. This documentation is free software; you can redistribute it and/or modify it only under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. This documentation is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with the program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA or see http://www.gnu.org/licenses/. NOTES
1. MySQL Internals Manual http://dev.mysql.com/doc/internals/en SEE ALSO
For more information, please refer to the MySQL Reference Manual, which may already be installed locally and which is also available online at http://dev.mysql.com/doc/. AUTHOR
Oracle Corporation (http://dev.mysql.com/). MySQL 5.5 01/30/2014 COMP_ERR(1)
All times are GMT -4. The time now is 02:06 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy