Non greedy (reluctant) regex matching in sed?

I'm trying to use sed to clean up lines of URLs to extract just the domain. So from: http://www.suepearson.co.uk/product/174/71/3816/ I want: http://www.suepearson.co.uk/ (either with or...

Grep. Line of text that does not end with "abcd"?

Hi I'm looking for a regular expression for: line of text that does not end with a certain word, let's say it's "abcd" At first I tried with .*[^abcd]$ That one doesn't work of course. It matches...

How do you non-interactively turn on features in a Linux kernel .config file?

I have a situation where our software needs to work with several different Linux kernel distributions / kernel trees. (including Android forks) In trying to automate our build process, I am...

Shell script - remove first and last quote (") from a variable

Below is the snippet of a shell script from a larger script. It removes the quotes from the string that is held by a variable. I am doing it using sed, but is it efficient? If not, then what is...

how to replace a variable in shell script string

I'm having problems getting this to work... I have a variable that is holding a SQL to with a placeholder: echo $SQL SELECT PX_PROMOTION_ID, PRIORITY, STATUS, EXCLSVE, TYPE, PERORDLMT,...

Git hook, modify commit files

I'm trying to write a Git pre-commit hook script. It should write the date of commit at the beginning of modified files. My problem is that I can't add modified files to the previous commit. When...

Take nth column in a text file

I have a text file: 1 Q0 1657 1 19.6117 Exp 1 Q0 1410 2 18.8302 Exp 2 Q0 3078 1 18.6695 Exp 2 Q0 2434 2 14.0508 Exp 2 Q0 3129 3 13.5495 Exp I want to take the 2nd and 4th word of every line like...

jquery ui modal dialog in browser full screen mode

I would like to have my jquery modal dialogs showing in the browser full screen mode however it is not displaying properly. It is possible to set the dialog in full screen mode by selecting it as...

Replacing special characters in a shell script using sed

I am trying to write a shell script that will replace whatever characters/strings I choose using sed. My first attempt worked with the exception of special characters. I have been trying to use...

Change WiFi WPA2 passkey from a script

I'm using Raspbian Wheezy, but this is not a Raspberry Pi specific question. I am developing a C application, which allows the user to change their WiFi Password. I did not find a ready...

Create HTML table using AWK/SED command on unix

I have a file that looks like this. Is there any way I could format the file to how I want it to look like ? ( see below ) I used various verisons of sed/awk but it seems to not work. The purpose...

Does lookbehind work in sed?

I created a test using grep but it does not work in sed. grep -P '(?<=foo)bar' file.txt This works correctly by returning bar. sed 's/(?<=foo)bar/test/g' file.txt I was expecting footest as...

How can I remove double line breaks with sed?

I tried: sed -i 's/\n+/\n/' file but it's not working. I still want single line breaks. Input: abc def ghi jkl Desired output: abc def ghi jkl

Convert bash function to fish's

Can someone help me convert this bash function to fish? It would also be nice if you could explain what these do like "${@%%.app}”, 's/ /.*/g’, "[email protected]\” etc. bid() { local shortname...

Rename file using xargs -a file

I have several files: test1.log test2.log test3.log test.txt test.txt contains: ./test1.log ./test2.log ./test3.log I want to be able to use my: test.txt with xargs -a test.txt ...... to...

Bootstrap offcanvas example on both (left and right) sides

I am trying to make bootstrap offcanvas example work for both sides. So far I managed to make it slide on both sides, but as I am not very good with css for some reason menus are not in place...

Add filename before first occurrence of a character in all lines for all files in a given folder

I have a folder full of files with lines which look like this: S149.sh sox preaching.wav _001 trim 889.11 891.23 sox preaching.wav _002 trim 891.45 893.92 sox preaching.wav _003 trim 1599.95...

Why does `overflow:hidden` prevent `position:sticky` from working?

In the following snippet, there is a sticky div positioned inside a container. It sticks to the top of the scrolling panel while staying inside its container all the time. This is the same...

Upgrade glibc 2.17 to 2.19+ on CentOS 7

First of all, Dropbox emailed me saying that I must upgrade glibc to 2.19+, otherwise Dropbox will not run.Then I follow the steps below to upgrade glibc. wget...

docker-compose/django TypeError: expected str, bytes or os.PathLike object, not NoneType

I'm trying to set up my Django and postgres dev environment with docker so I can run it on other machines more easily as well as run everything from 1 terminal window (I'll be adding my react...

How to enhance a script for look ups from multiple CSV files

I need to enhance my below script, which takes an input file that contains almost a million unique lines. Against each line, it has different values in 3 lookup files which I intend to add in my...

Animate a div from bottom to top with css

I need to animate a div going from bottom to top. This is the situation: I have a thumbnail that includes the title and description of a movie inside of it. I want to hide the description and only...

React Tour get wrong position when using with Slide transition in Dialog Material UI

As described, I'm using react-tour to implement a guidance for my project. The First step is a small component that stays inside a <Dialog /> that needs to be highlighted. But due to the...

How to disable Teams Auto markdown using Incoming Webhook

I'm trying to post some text to a Teams Channel. Contents of my bash script: #!/bin/bash TITLE="MESSAGE TITLE" COLOR="FF0000" MESSAGE="This is my A_B_C...

Chip with long text in Vuetify

I'm using the component v-chip from Vuetify, it cuts the text when the text is too long, is there any workaround for this? new Vue({ el: '#app', vuetify: new Vuetify(), data() { return...

Cloud Run: Forbidden error while accesing service

I have created a Wordpress Service using CLoudRun . I deployed using below command gcloud beta run deploy wp --image gcr.io/<project>/wp:v1 \ --add-cloudsql-instances...

Is there any way to see the output of a shell script when launched through make, for SAM

I'm trying to build a multi-layer Python SAM (AWS Serverless Application Model) app. Nothing too fancy, but it has some dependencies, which are managed using pipenv. SAM has a sam build command...

Systemd service file doesn't read the environmentFile

I am trying to start etcd service and I have a environment variable file that I am referring by the systemd file. First time it works fine and in the next time when I try to stop the service and...

PHP oci8 installation fails on Ubuntu 18

I'm trying to install oci8 through pecl, following this link. I successfully installed oci8 following these steps last year, before the release of php8.0. This is my configuration: Ubuntu...

Count trailing newlines with POSIX utilities or Perl

I'm looking for ways to count the number of trailing newlines from possibly binary data either: read from standard input or already in a shell variable (then of course the "binary" excludes at...