Solved

Shell Script - Syntax help

Posted on 2011-03-23
2
397 Views
Last Modified: 2012-05-11
What does it mean if they say the following

Edit Makefile with following commands:
1,$s?/lib/ ?/lib32/ ?g
1,$s?-q64??g
1,$s?/lib/sysliblist?/lib32/sysliblist?g
0
Comment
Question by:mnis2008
2 Comments
 
LVL 77

Expert Comment

by:arnold
ID: 35204432
Is this a homework assignment? Presumably the editor used is VI/VIM,etc.
The initial parameter deals with the scope.
The next deals with the action and the condition under which the action is taken.
The end entry deals with specifying options i.e. case sensitive insensitive, repeat, etc.
 
0
 
LVL 48

Accepted Solution

by:
Tintin earned 500 total points
ID: 35204676
1,$  means from line 1 to the end of file

s means substitute

s?/lib/ ?/lib32/ ?g  means substitute all occurances of /lib/ with /lib32/
s?-q64??g means substitute all occurences of -q64 with nothing, ie: delete it
s?/lib/sysliblist?/lib32/sysliblist?g means substitute all ocurrences of /lib/syslibist with /lib32/sysliblist
0

Featured Post

Windows Server 2016: All you need to know

Learn about Hyper-V features that increase functionality and usability of Microsoft Windows Server 2016. Also, throughout this eBook, you’ll find some basic PowerShell examples that will help you leverage the scripts in your environments!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Fine Tune your automatic Updates for Ubuntu / Debian
Google Drive is extremely cheap offsite storage, and it's even possible to get extra storage for free for two years.  You can use the free account 15GB, and if you have an Android device..when you install Google Drive for the first time it will give…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…
This demo shows you how to set up the containerized NetScaler CPX with NetScaler Management and Analytics System in a non-routable Mesos/Marathon environment for use with Micro-Services applications.

808 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question