- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- sed version ( HPUX , GNU)
Categories
Company
Local Language
Forums
Discussions
Forums
- Data Protection and Retention
- Entry Storage Systems
- Legacy
- Midrange and Enterprise Storage
- Storage Networking
- HPE Nimble Storage
Discussions
Discussions
Discussions
Forums
Forums
Discussions
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
- BladeSystem Infrastructure and Application Solutions
- Appliance Servers
- Alpha Servers
- BackOffice Products
- Internet Products
- HPE 9000 and HPE e3000 Servers
- Networking
- Netservers
- Secure OS Software for Linux
- Server Management (Insight Manager 7)
- Windows Server 2003
- Operating System - Tru64 Unix
- ProLiant Deployment and Provisioning
- Linux-Based Community / Regional
- Microsoft System Center Integration
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Discussion Boards
Community
Resources
Forums
Blogs
- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 02:30 AM
тАО03-19-2009 02:30 AM
how can i find out the version of sed from HPUX (11.X) ? sed -V doesn't work , manpage also doesn't show a version
why i want the version of sed ? i am thinking now about the use of GNU "sed-4.1.5" because a colleague from the LINUX department showed me the option "sed -i". i think this a very good option.
do anybody have expierences of GNUD "sed" ?
in many scripts are commands like this:
sed -e "/^locks/s/ADMIN:/user:/p" \
< RCS,v \
> tempfile
if [ -s tempfile ]
then
rm -f RCS,v
mv tempfile RCS,v
fi
i had the problem, when i want to move the "tempfile" , it didn't exist in some special cases ... so i have to make a backup of the RCS,v file and when the move isn't ok , i have to try it again .
i think a good use of GNU "sed" ? or i have to correct the commands? or use other tools like "ed" ?
regards
Solved! Go to Solution.
- Tags:
- sed
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 03:38 AM
тАО03-19-2009 03:38 AM
SolutionAs for the version of an HP-UX 'sed' you have to rely on comparisons with:
# what /usr/bin/sed
GNU 'sed' has inplace updating as you stated, obviating the need redirecting to a temporary file and then replacing the source file with the newly modified one.
Perl accomodates this:
# perl -pi.old -e 's/ADMIN:/user:/ if /^locks/' RCS,v
The '-i' switch enables inplace modification. The ".old" is an optional argument to it that causes a backup copy of the original file to be retained with the suffix of ".old" appended. If you don't want th backup, simply use '-i' alone.
Regards!
...JRF...
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 04:07 AM
тАО03-19-2009 04:07 AM
Re: sed version ( HPUX , GNU)
strings /usr/bin/sed |grep version
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 04:24 AM
тАО03-19-2009 04:24 AM
Re: sed version ( HPUX , GNU)
>
> strings /usr/bin/sed |grep version
Did you try this, or were you guessing?
Around here:
dyi # strings /usr/bin/sed |grep version
dyi #
For some potentially useful info:
dyi # what /usr/bin/sed
/usr/bin/sed:
$Revision: B.11.31_LR
But I don't know what the actual value of
this is to you.
I can't recall ever needing to use GNU "sed",
but I'd expect it to be harmless.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 04:48 AM
тАО03-19-2009 04:48 AM
Re: sed version ( HPUX , GNU)
steven: strings /usr/bin/sed |grep version
is a good trend to find out the version. but HPUX didn't show version , no problem.
i will use the perl solution. perl is now a standard product of HPUX. GNU "sed" looks good,but i have to install on many servers with different HPUX versions.
thanks to all
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 08:19 AM
тАО03-19-2009 08:19 AM
Re: sed version ( HPUX , GNU)
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО03-19-2009 10:38 PM
тАО03-19-2009 10:38 PM
Re: sed version ( HPUX , GNU)
unlike linux where there is no tie between kernel & user land, and the tools develop regardless of what the kernel team is doing. it makes sense to have versions in GNU.
afaik bsd is the same story. the base user land tools come with a certain release of bsd and that is then basicly your 'version'.