Creating a Script

More
27 Mar 2013 20:53 #31967 by BigJohnT
Replied by BigJohnT on topic Creating a Script
I think your on to something now... can you attach one if they are not too huge?

John

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 20:58 #31968 by BigJohnT
Replied by BigJohnT on topic Creating a Script
I just remembered that notepad++ can strip windoZe end of line stuff...

John

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 21:35 #31971 by Todd Zuercher
Replied by Todd Zuercher on topic Creating a Script
Well, I am not entirely sure what fixed it but it is working now.

Last time I booted to Linux, I reinstalled a bunch of python stuff using Synaptic. But the script still wasn't working though. So I booted back to Win to get some work done, and Just now I booted back to Linux and deleted some of the old script files and replaced them with new ones, and tried running them again from terminal and they worked not a big shock that the command line one worked (since I had it working before), but the new one that just prints the output also ran fine (it didn't before). So I fired up Axis and all was good.

I wish I knew what the real problem was. I don't think it was recopying the scripts since I thought I tried that last time. I'll go give it a try on another computer who's Linux install hasn't been futzed with quit so much and see what happens.

I am guessing it was something I installed or reinstalled combined with the reboot that got it working.

I already use notepad++ for all my editing in Windows.

Please Log in or Create an account to join the conversation.

More
27 Mar 2013 21:47 #31972 by arvidb
Replied by arvidb on topic Creating a Script

Would it be possible to use the sed line with some other stuff to add a pre and postamble as well.

You can use echo to print lines of text, and cat to display contents from other files:
#!/bin/bash

echo "This line ends up before the output"
# Empty line:
echo

# The main part
sed 's|Z\([-.0-9]*\)|Z\1 W\1|g' "$1"

# Post-amble from file post.txt:
cat post.txt

Don't know if that is what you're after? Anyway, the python script seems to work now, so perhaps this is moot.

Please Log in or Create an account to join the conversation.

Time to create page: 0.606 seconds
Powered by Kunena Forum