format code error out using bash script beautifer...


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting format code error out using bash script beautifer...
# 1  
Old 12-15-2010
format code error out using bash script beautifer...

hello all, In refrence to below thread...i am trying to format code using ruby beautifer.... as its mentions....below is the link

https://www.unix.com/shell-programmin...ll-script.html

It says use Bash Script Beautifier(http://www.arachnoid.com/linux/beaut...ex.html)...but i cant seems to get that working....

I do exactly what it tells me to do on the link...but cant seem to get that working...

[db11g]-/usr/local/bin >beautify_bash.rb (/home/oracle/test.sh)
-bash: syntax error near unexpected token `/home/oracle/test.sh'

what am i doing wrong ?

or is there any other freeware program that i can use to format/beautiful my code...instaead of doing it manually
# 2  
Old 12-15-2010
Hi.

Try it without the parens:
Code:
beautify_bash.rb /home/oracle/test.sh

I think it re-writes the file, so use a copy of the file.

Best wishes ... cheers, drl
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script accepting variables in valid number format

Hi Experts I would like to ask if there is a way to validate if the variable passed is in this kind of sample format "06-10" or "10-01". It was really a challenge to me on how to start and echnically the "6-10" stands for "June 10" and "10-01" stands as "October 1", overall it needs to have ... (3 Replies)
Discussion started by: ersan-poguita
3 Replies

2. Shell Programming and Scripting

Executing perl script in Linux gives :Exec format error. Wrong Architecture

i have perl script that used to be working great , once i edit it in windows and convert it to UTF-8 and then via FTP return it . also did: chmod +x foo.pl and then when i try to run it : ./foo.pl im getting this error: ./foo.pl: Exec format error. Wrong Architecture.... (4 Replies)
Discussion started by: umen
4 Replies

3. UNIX for Dummies Questions & Answers

Date format in Bash Script

Hi Experts I'm struggling with the dates in bash scripting. here is my code due1=`grep "$member" Due.txt | tail -n 1 | cut -d "," -f2 | tr -d "\15"` duedate1=`date +%Y-%m-%$due1` echo $due1 echo $duedate1 if I execute the above code I get output as 10 2013-09 %10 ... (2 Replies)
Discussion started by: parpaa
2 Replies

4. UNIX for Dummies Questions & Answers

Date format in Bash Script

Hi Experts, We get "Day" of a month in a variable, so how to make date of out it? To make more sense if my variable $DAY contains "12" and month and year will be current date (as of today) so I want to see as output as 2013-09-12. How can I achive this bash script?? Any help is... (4 Replies)
Discussion started by: parpaa
4 Replies

5. Shell Programming and Scripting

Help to write bash script code

I am newbie to UNIX. I came across this exercise in one the books.Can anyone help me with this question?????? Write a short Bash script that, given the name of a file as an argument, reads the file name and creates a new file containing only lines which consist of one word. Here is an example... (4 Replies)
Discussion started by: krthknaidu
4 Replies

6. Shell Programming and Scripting

HOW to run a bash-code in a c-shell script ??

Is there a way to run some code in a C-shell script by different shell, like bash? I have that situation. I have prepared and perfectly workable bash-skript that now I have to execute under C-shell script, divide it on steps and without creating a new files (with the bash-code parts.) For... (6 Replies)
Discussion started by: alex_5161
6 Replies

7. UNIX for Dummies Questions & Answers

Code stripper for bash script..

Dear all, Is there any open source tool for stripping the comments to bash script without affecting the code part? Please give me any reference to it.. Thanks in Advance... (2 Replies)
Discussion started by: Nila
2 Replies

8. Shell Programming and Scripting

automatically format Shell Script (bash)

Hi In TOAD I can write SQL code, then select the SQL code -> Menu Edit -> Format Code The output is well formatted code (correct indent, ...) Is there a tool (for Windows and/or UNIX) what can do the same for bash code? TOAD (software) - Wikipedia, the free encyclopedia (1 Reply)
Discussion started by: slashdotweenie
1 Replies

9. Shell Programming and Scripting

Help in error seen in the Bash script

Hi, I am currently encounter an error of:- ./max.bash: line 45: then max=0 else max=$maximum It seems that it does not allow max to assigned with floating numbers. Please help. Thanks. (2 Replies)
Discussion started by: ahjiefreak
2 Replies

10. Shell Programming and Scripting

Bash Script error?

I'm currently playing with the below script; #!/bin/sh for d in /export/home/siward/staff/pasit/jamiecr/scripts/first-file.sh \ /export/home/siward/staff/pasit/jamiecr/scripts/second-file.sh \ /export/home/siward/staff/pasit/jamiecr/scripts/third-file.sh \ ... (13 Replies)
Discussion started by: JayC89
13 Replies
Login or Register to Ask a Question