Category "shell"

Checking if the string is in proper format in Shell Scripting

I am trying to check if the string is in format in shell script. below is the code i am trying and the output i want to get. Format: <datatype>(length,len

Remove percentage printf and shell

I'm beginning to learn the shell commands. And I don't know how to remove the percent character in the end. Example: printf poo shows poo% I'm on mac and I us

"source" command on mac

I have a .bashrc file on Mac OS in which I set some aliases. After I make it and I type source .bashrc, the aliases work perfectly. However if open another shel

Increment variable value by 1 (shell programming)

I can't seem to be able to increase the variable value by 1. I have looked at tutorialspoint's Unix / Linux Shell Programming tutorial but it only shows how to

replace special character [ and ] including . using sed

I would like to replace the [sample]. with space in all my document.Could someone let me know how can I do this.I tried the below command but it doesn't work.th

Fish shell - advanced control flow

Normally, fish shell processes commands like this: 1 && 3 (2) This is perfectly useful and it mirrors the order of execution that I would want most of

Shell script not running via crontab, but runs fine manually

I have a script that checks if the PPTP VPN is running, and if not it reconnects the PPTP VPN. When I run the script manually it executes fine, but when I make

Docker compose create kafka topics

Problem: Cannot create topics from docker-compose. I need to create kafka topics before I run a system under test. Planning to use it as a part of the pipeline,

How to run functions and local resources over SSH in a shell script

I have a shell script file like this: #!/bin/bash CONF_FILE="/tmp/settings.conf" #settings.conf contains OS_NAME="Caine Linux" source $CONF_FILE display_os_n

What is the difference between p and P in sed?

Can anyone explain what is the difference between p and P in Sed? Suppose I want to print lines containing gmail in the below file using both p and P give the

python script to open tera term application and sending keys

I am trying to use Python script to run Tera Term application to open console for Serial port communication and i am sending some commands/keys like {Enter}

How to read a specific value in PLIST file in terminal

I'm trying to access a specific property in a plist file on my MAC OS, but the name of that property has a space in it and I cannot access it. here is the reque

Gitlab Shell Script Permission Denied

I am running a simple shell script with Gitlab CICD and I am getting Permission denied. Kindly suggest When I do chmod +x test.sh it says operation not permitte

Linux Command , how to find files by size larger than x?

I'm trying to find files with size larger than "x" , ex: 32 bytes But what I found in ls --help was only ls -S , that just sort by size and not satisfied my d

What are the differences between a login shell and interactive shell?

What is a login shell and interactive shell, and what is a .bash_profile and .bashrc?

How to check if a user disconnected, if it's a new disconnection and the server on which the action was made?

I have to create a shell program, such that each time certain users (given as parameters) connect/disconnect from the system, it will save in a text file if its

git shell command doesn't work with IdeaVim

I'm using intelliJ for IDE and installed IdeaVim. I'm trying to execute git status inside vim but it didn't work and nothing to show. :! git --help and :! ls

How to write a single line shell script with a while loop and if statement

I am trying to figure out the syntax for having a while loop and an if statement that checks for more than one condition, in a single-line shell script. Execut

-bash: __git_ps1: command not found

I tried to install Ruby 2.0. My command line urped and now looks like the following: -bash: __git_ps1: command not found [11:58:28][whatever@whatever ~]$ I

Using sed to replace tab with spaces

I'm trying to replace the tab with 4 spaces, using sed, but it is not working. Here is my code: sed -i '{s/\t/ \{4\}/g}' filename Any suggestion is apprecia