Solved

Shell Script - Syntax help

Posted on 2011-03-23
2
395 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 76

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

Better Security Awareness With Threat Intelligence

See how one of the leading financial services organizations uses Recorded Future as part of a holistic threat intelligence program to promote security awareness and proactively and efficiently identify threats.

Join & Write a Comment

I promised to write further about my project, and here I am.  First, I needed to setup the Primary Server.  You can read how in this article: Setup FreeBSD Server with full HDD encryption (http://www.experts-exchange.com/OS/Unix/BSD/FreeBSD/A_3660-S…
Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
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…

760 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now