Sed, bash problems migrating from Cray to GNU/Linux
So, I have a series of ASCII files, all named something like mrkxxxxz.tmp (say, mrk1001z.tmp, mrk1002z.tmp, mrk1003z.tmp,...) -- these are .tmp files created by a large simulation program, and each different .tmp file represents a different parameter space used in the simulation). The simulations were originally run on a Cray, and on said platform, I would run the following shell script (which I call simbatch) to process them, and send them off to a FORTRAN application called 'mark':
Now, this works fine on the Cray, but under Linux, nada. I get all sorts of errors:
I'm *guessing* this is a problem with 'quoting' things, but I'll be darned if I've hit on the right combination.
Hi, the problem is here:
Which should be
or
Your old shell (on the Cray) may have happened to accept it, but it is not correct.
--
Also note that because of the single quotes, the variables will not be expanded:
If you need them expanded, use double quotes instead of single quotes...
--
Since "$@" is the default you can also just omit it:
or
This:
is officially not allowed in the Posix specification, but most modern shells do not have a problem with it, unlike earlier Bourne Shells.
Last edited by Scrutinizer; 02-09-2014 at 04:37 PM..
These 3 Users Gave Thanks to Scrutinizer For This Post:
Perfect -- thanks *very* much. I had guessed my way through things and by brute force had gotten some things working, but your reply cleared everything up perfectly.
Original script written on CentOS 6.3 with GNU bash 4.1.2
Destination system is Solaris 9 with GNU bash 2.05 (not changeable by me)
I have a script written on the linux side but now we need to provide a version to another site that "doesn't like linux". I've been going through changing the ] or... (13 Replies)
hey frnds I am trying to migrate a bash script over the AIX machine , but was getting error with ps and read commands, so I make the few changes in script and have also chnaged the shell from bash to ksh
below is my script... (5 Replies)
Hello all,
We would be migrating from HP-UX 11 to Red Hat Linux 5 shortly. On HP-UX we've been using RCS (Revision Control system). On RHEL I think there is an equivilant utility called Subversion..Is there a way to export the current contents from RCS in HP-UX and import it into Linux's... (2 Replies)
Hi all,
We have an application that is running on HP-UX operating system (11i). the application is built using C, C++, ProC and ProC++ codes.
we have been given two choices for migration: LINUX and SOLARIS.
I would like to know the differences between the three OS and which OS to prefer... (3 Replies)
Hello everyone...
I'm trying to find an interesting project to work on
for my master thesis. I like GNU/Linux C development
and BASH scripting. Please give me any idea that
flashes in your mind.
I thank you in advance... (3 Replies)
I'm sure this is simple and I've been looking at examples for days on end but can't seem to come to grips with awk. What I have:
mplayer -v dvd:// -identify -vo null -ao null -nolirc -nojoystick -frames 0 2>/dev/null >> /tmp/MplayerOut
ChapterStart=($(grep CHAPTERS: /tmp/MplayerOut |sed... (3 Replies)
Is there a way to migrate username password from Freebsd 6.1 to Linux Ubuntu 8.04. I am using the server as a email server running postfix and using imap. Is there a way to transfer the usernames and password. I have transferred all the Maildirs but I am getting uid errors and gid errors even after... (2 Replies)
Hi, I'm writing a long script for bash (on RHEL 5.0) to execute many commands. So, my idea is to create a function to deal with error checking and logging (see ceckoutput() below). This works with all commands except for sed. I think it may be a problems with escaped characters. So I did the... (4 Replies)