- Community Home
- >
- Servers and Operating Systems
- >
- Operating Systems
- >
- Operating System - HP-UX
- >
- Perl Help
Operating System - HP-UX
1759677
Members
3608
Online
108886
Solutions
Forums
Categories
Company
Local Language
юдл
back
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
юдл
back
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
Blogs
Information
Community
Resources
Community Language
Language
Forums
Blogs
Go to solution
Topic Options
- 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
тАО05-16-2005 03:56 PM
тАО05-16-2005 03:56 PM
Dear Gurus,
I am creating a script for data manipulation..
Below is the sample line.
...
...
export difflotid=$(grep "" $EFILE | awk -F \" '{print $2}')
This would get the value and store it to difflotid variable.
I will be using this variable to be transfer/use in other file.
Perl is suitable for in-line editing for me.
I need to know the syntax (Perl) to replace the the following line below using the difflotid variable from another file.
...
...
Diffusion Lot ID, 11111-11
...
...
Maximum points for all correct replies.
I am creating a script for data manipulation..
Below is the sample line.
...
...
export difflotid=$(grep "
This would get the value and store it to difflotid variable.
I will be using this variable to be transfer/use in other file.
Perl is suitable for in-line editing for me.
I need to know the syntax (Perl) to replace the the following line below using the difflotid variable from another file.
...
...
Diffusion Lot ID, 11111-11
...
...
Maximum points for all correct replies.
Solved! Go to Solution.
3 REPLIES 3
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2005 05:59 PM
тАО05-16-2005 05:59 PM
Solution
You can do this with a single script as,
#!/bin/ksh
export difflotid=$(grep "" $EFILE | awk -F \" '{print $2}')
..
# It will automatically update in filename with changes
perl -pi -e "s/^Diffusion LotID.*/$difflotid/"
..
HTH.
#!/bin/ksh
export difflotid=$(grep "
..
# It will automatically update in filename with changes
perl -pi -e "s/^Diffusion LotID.*/$difflotid/"
..
HTH.
Easy to suggest when don't know about the problem!
- Tags:
- Perl
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-16-2005 07:35 PM
тАО05-16-2005 07:35 PM
Re: Perl Help
The above works... but I'd use
perl -i.org -pe "s/Diffusion Lot ID.*/$difflotid/"
This will save as .org & will have the edits in it
Regards
Tim
perl -i.org -pe "s/Diffusion Lot ID.*/$difflotid/"
This will save
Regards
Tim
-
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
тАО05-17-2005 12:36 AM
тАО05-17-2005 12:36 AM
Re: Perl Help
You can also use sed instead of perl for this as,
sed "s/^Diffusion LotID.*/\$difflotid/" >
IF you want to update into the same file then,
sed -i "s/^Diffusion LotID.*/\$difflotid/"
hth.
sed "s/^Diffusion LotID.*/\$difflotid/"
IF you want to update into the same file then,
sed -i "s/^Diffusion LotID.*/\$difflotid/"
hth.
Easy to suggest when don't know about the problem!
- Tags:
- sed
The opinions expressed above are the personal opinions of the authors, not of Hewlett Packard Enterprise. By using this site, you accept the Terms of Use and Rules of Participation.
News and Events
Support
© Copyright 2024 Hewlett Packard Enterprise Development LP