Solved

Shell Script - Syntax help

Posted on 2011-03-23
2
400 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 78

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

Containers and Docker for Everyone

Containers are an incredibly powerful technology that can provide you and/or your engineering team with huge productivity gains. Using containers, you can deploy, back up, replicate, and move apps and their dependencies quickly and easily.

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 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…
This video shows how to set up a shell script to accept a positional parameter when called, pass that to a SQL script, accept the output from the statement back and then manipulate it in the Shell.

729 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