DaemonForums  

Go Back   DaemonForums > Miscellaneous > Programming

Programming C, bash, Python, Perl, PHP, Java, you name it.

 
 
Thread Tools Display Modes
Prev Previous Post   Next Post Next
  #1   (View Single Post)  
Old 4th January 2016
shep shep is offline
Real Name: Scott
Arp Constable
 
Join Date: May 2008
Location: Dry and Dusty
Posts: 1,503
Default xterm default shell differences between OpenBSD and FreeBSD/NetBSD

I digested about 1/3 of a book on shell scripting and have been trying to add weather information to an openbox window manager.
The following works with the default shell in FreeBSD and NetBSD:
~/scripts/weather.sh
Code:
#!/bin/sh
curl -sk http://weather.noaa.gov/pub/data/observations/metar/decoded/KYKM.TXT | \
fold -w 78 -s
echo ""
read -p "<Enter to Close>" nothing
Which I call with the following openbox menu entry
Code:
xterm -g 78x16+150+38 -T "Yakima, WA Weather" -e ~/scripts/weather.sh
When I try the same script/menu entry in OpenBSD the xterm does not wait for "read" input and closes immediately.

Using $ xterm -hold -e ~/scripts/test.sh I get the following:
Code:
YAKIMA AIR TERMINAL, WA, United States (KYKM) 46-34N 120-32W 324M
Jan 04, 2016 - 04:53 PM EST / 2016.01.04 2153 UTC
Wind: Calm:0
Visibility: 10 mile(s):0
Sky conditions: mostly cloudy
Temperature: 30.0 F (-1.1 C)
Dew Point: 21.9 F (-5.6 C)
Relative Humidity: 71%
Pressure (altimeter): 29.82 in. Hg (1009 hPa)
ob: KYKM 042153Z 00000KT 10SM BKN014 M01/M06 A2982 RMK AO2 SLP112 T10111056
cycle: 22

./test.sh[5]: read: -p: no coprocess
Ideally, I would like the scripts to be portable. Can someone give me a brief explanation and suggestions about how to script this for OpenBSD? Ultimately, I would like to pass the output into a dialog program like zenity or yad.

Last edited by shep; 5th January 2016 at 02:51 AM. Reason: added output from OpenBSD 5.8
Reply With Quote
 

Thread Tools
Display Modes

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

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Underlegend Networks - NetBSD free shell server muflon Off-Topic 1 8th September 2015 01:53 PM
Differences between the Linux and BSD world summarized harishankar Other OS 6 18th December 2013 12:05 PM
xterm is not a login shell except on blackbox daemonfowl NetBSD General 6 1st August 2012 03:59 AM
Differences in processing in POWER CPUs. Ninguem General Hardware 5 25th August 2011 03:30 PM
BSD UNIX Toolbox: 1000+ Commands for FreeBSD, OpenBSD and NetBSD anomie Book reviews 8 28th July 2008 09:32 PM


All times are GMT. The time now is 10:57 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
Content copyright © 2007-2010, the authors
Daemon image copyright ©1988, Marshall Kirk McKusick