Quick-and-dirty g++ compilation


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Quick-and-dirty g++ compilation
# 1  
Old 03-05-2007
Quick-and-dirty g++ compilation

I am creating a small bash file that will take one argument and compile it:
Code:
#!/bin/bash 

OUT=${$1%.cpp} # C++ source files always end in .cpp 
g++ -Wall $1 -o $OUT 
chmod 777 $OUT

The error message says 'bad substitution', namely where OUT is defined. How to fix this?
# 2  
Old 03-05-2007
Change OUT=${$1%.cpp} to OUT=${1%.cpp}

Note the change from $1 to 1
Login or Register to Ask a Question

Previous Thread | Next Thread

7 More Discussions You Might Find Interesting

1. What is on Your Mind?

Anybody want to talk about Dirty Cow?

Hi All, How worried is everyone about the Dirty Cow Linux exploit? Has anybody experienced attacks yet? From the research I've done it seems that the exploit is "reliable" (that is it works nearly every time on vulverable systems) which is not good news. We all believe that Unix/Linux... (3 Replies)
Discussion started by: hicksd8
3 Replies

2. UNIX for Advanced & Expert Users

Superblock marked dirty

Good morning! I met a problem on a FS with AIX 5.3 It's not possible to mount the FS because of a dirty superblock. I tried few things without success. I need your help to solve my problem guys. Do you have any idea please? Thanks a lot drp01,/home/root # mount /GSPRES/data Replaying... (9 Replies)
Discussion started by: Castelior
9 Replies

3. Shell Programming and Scripting

Need a quick and dirty solution

I have a list of multiple versions of software. The list is formated as follows: NAME VERSION I simply need to pull out the highest version of each software, for example: Original File a v1.0 a v1.1 a v1.2 b v2.1 b v2.2 b v2.21 b v3.0 Output a v1.2 b v3.0 (13 Replies)
Discussion started by: Finja
13 Replies

4. Shell Programming and Scripting

noob question - is awk the tool to clean dirty text files?

Hi, nevermind. I think I've found the answer. It appears I was looking for index, match, sub, and gsub. I want to write a shell script that will clean the html out of a bunch of files and format the data for import into excel. Awk seems like a powerful tool, but it seems oriented to... (1 Reply)
Discussion started by: yogert909
1 Replies

5. UNIX for Dummies Questions & Answers

Compilation

Hi All, We have a C program existing in one of the folders which I have to modify a lil bit, When I'm trying to compile the program using GCC or CC command its showing as ksh: gcc: not found is that mean there is no compiler or do I have to verify for something, please advice Thank... (2 Replies)
Discussion started by: diggermf
2 Replies

6. UNIX for Advanced & Expert Users

Finding volumes with mirrored DRL(Dirty Region Log)

hi, How do I find VxVM volumes which have a mirrored DRL. thanks in advance Prasi (2 Replies)
Discussion started by: prasi_in
2 Replies

7. AIX

Can't mount showing 0506-342 The superblock on /dev/fslv00 is dirty

Dear All Last day in Aix 5.2 server by executing # df –g I found following: Filesystem GB blocks Free %Used Iused %Iused Mounted on . . /dev/fslv00 58.00 136.70 -135% 212103 1% /sprod After shutting down by following command # shutdown –h And when... (1 Reply)
Discussion started by: xa52000
1 Replies
Login or Register to Ask a Question