-
as seen on Stack Overflow
- Search for 'Stack Overflow'
I want to replace the a string with the word string as the following example down , but if a string exist also after comment then a string will replaced too
In which way I can add to the sed command the irregular exp that ignore from the #.
[root@localhost tmp]# more test
a
b
aa
bb
#a
#b
#aa
#bb
[root@localhost…
>>> More
-
as seen on Stack Overflow
- Search for 'Stack Overflow'
Hi,
I am using the following script to search and replace the deprecated functions in a file with the newer ones.
5 for strFile in `ls deprecated_functions_search_and_replace.txt `
6 do
7 sed "s/ereg_replace[^\(]*(\([^,]*\),/preg_replace\1('#'.\2.'#',/g" $strFile > temp_file
8 …
>>> More
-
as seen on Pro Webmasters
- Search for 'Pro Webmasters'
I have a footer which is set to 100% width, but if i size the window smaller so a horizontal scrollbar appears, using the scrollbar shows whitespace to the right of the footer ... its not spanned 100% of the page, just the viewport.
<!doctype html>
<html lang="en" class="no-js">
<head>
…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
$ sed "s/\(^[a-z,0-9]*\)\(.*\)\( [a-z,0-9]*$\)/\1\2 \1/g" desired_file_name
I apreciate it even if you only explain part of it or at lest structure it with words as in s\alphanumerical_at_start\something\alphanumerical_at_end\something_else\global
Could someone explain what that means, why and…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
Hello there.
I'm having a problem using the sed command . I'm trying to write a bash script that does the following :
search for the line that contain :@
then save the line that contained :@ and replace it with new line
as in the following:
#! /bin/bash
echo "Please enter the ip address…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
When I run a program from the console, e.g.
me@box:~$ firefox
I expect the console to log error messages (I think this is std out or std err?) and other items from the program, firefox in this case.
But today I notice that bash just opens the program and goes to a new prompt, e.g.
me@box:~$…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting:
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: tar: command…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
I was updating my .bash_profile, and unfortunetly I made a few updates and now I am getting:
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
env: bash: No such file or directory
-bash: tar: command…
>>> More
-
as seen on Super User
- Search for 'Super User'
ps -e | grep bash
sample output from a linux machine:
1128 pts/14 00:00:00 bash
7491 pts/7 00:00:00 bash
12651 pts/14 00:00:00 bash
16145 pts/2 00:00:00 bash
sample output from a mac machine:
58352 ttys000 0:00.09 login -pfl username /bin/bash -c exec -la bash /bin/bash
58353 ttys000…
>>> More
-
as seen on Ask Ubuntu
- Search for 'Ask Ubuntu'
First login process name seems to be set to "-bash", but if I subshell then it becomes "bash". for example:
root@nowere:~# echo $0
-bash
root@nowere:~# bash
root@nowere:~# echo $0
bash
-bash is causing some scripts to fail, such as . /usr/share/debconf/confmodule
exec /usr/share/debconf/frontend…
>>> More