The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Top Forums > Shell Programming and Scripting
.
google unix.com



Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
shell differences? hi2_t UNIX for Dummies Questions & Answers 2 09-09-2009 11:42 AM
bash shell: 'exec', 'eval', 'source' - looking for help to understand alex_5161 Shell Programming and Scripting 3 07-24-2008 01:42 PM
C shell & Bourne Shell jsm66 Shell Programming and Scripting 3 02-12-2007 03:19 AM
bourne shell or korn shell? XZOR UNIX for Dummies Questions & Answers 2 10-06-2006 03:34 AM
Bourne-again shell mrsamer UNIX for Dummies Questions & Answers 3 09-30-2006 03:42 AM

 
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
Prev Previous Post   Next Post Next
  #1 (permalink)  
Old 3 Weeks Ago
awk_sed_hello awk_sed_hello is offline
Registered User
  
 

Join Date: Jun 2009
Location: Loveland, Colorado
Posts: 7
I need to understand the differences between the bash shell and the Bourne shell

I do not claim to be an expert, but I have done things with scripts that whole teams of folks have said can not be done. Of course they should have said we do not have the intestinal fortitude to git-r-done.

I have been using UNIX actually HPUX since 1992. Unfortunately my old computer died and the proprietary software that I was using can not be used on Win 7. I downloaded cygdrive so that I could continue to run several awk and sed scripts I have written. These worked fine in my old Bourne shell (sh)

1st Question/comment. I have seen that #!/bin/bash must be the first line of a script. I see this as a comment not a command. Seems to me that there is confusion either on my part or the rest of the world.

The previous permissions on my script were lost probably due to windows.

I changed my script "trans_xy" to full permissions

"trans_xy"
Code:
#!/bin/bash # I think this command is BS > debug effort
# Process XY data
echo Process XY data
#cp 60-121130-01r2_ipc.net ipc # debug attempt ipc exist
sed s/" -"/" DOT."/ ipc > raw
awk '$2~/MTG/{print $0}' ipc > mtg
awk '$2~/TP/{print $0}' ipc > tp
awk '$3~/DOT/{print $0}' raw > raw1
awk '$2~/VIA/{print $0}' raw1 > vias
awk '$2!~/VIA/{print $0}' raw1 > raw_xy
sed s/"R180"/" R180"/g raw_xy > raw_xy_1
sed s/"R270"/" R270"/g raw_xy_1 > raw_xy_2
chmod 777 trans_xy
ls -l
trans_xy -rwxrwxrwx

the result copied from the bash window intresting font from the stdout

Code:
$ ./trans_xy
Process XY data
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory
: No such file or directory_1
: No such file or directory_2
If I paste the commands into bash they work like a champ.
I suspect that bash does not know to do it's work in the pwd it seems odd that the output file is referenced in the crude error message displayed on the stdout.

Notice that the error message is screwed up

command from script
sed s/"R180"/" R180"/g raw_xy > raw_xy_1
result
: No such file or directory_1

command from script
sed s/"R270"/" R270"/g raw_xy_1 > raw_xy_2
result
: No such file or directory_2

Does anyone know if what the heck is happening here?

Last edited by pludi; 3 Weeks Ago at 01:35 PM.. Reason: cleanup
 

Bookmarks

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 06:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0