Skip to content

Tag: bash

check password linux user

I am on debian 9. I have a problem to check the password of a linux user in my scripts. I realized that the different linux tools for creating and modifying a user password gave results of different pattern in /etc/shadow To create a user I have in /etc/shadow In another script I want check the password input…

Printf tab character as hex

In a restricted shell i have only access to execute printf (no awk, hexdump, xxd, …), so i used this script to print a file as hex: issue: last line (printf %02x ‘${a:$i:1}) does not work for some character like s,r,n,t,… i handle space character with (printf “%X” ‘ ‘…

get user input in awk script and update it in file

I have a students.txt (RollNo, Name, IDU, CGPA), If Roll number exists prompt the user to change the IDU and CGPA and update the same in the file named “Student.txt” I made the following script: now I need help in taking user input for IDU and CGPA values and update the students.text file with that values aga…

Bash Read CSV value from Variable in Bash

So in a script I have a variable that changes each time the script is run. The variable is IP_PING. It is basically a list of if address seperated by commas. I want the script to take each ip addess in the csv variable and ping it. The example below works fine if I only have one ip address in

How To Substitute Piped Output of Awk Command With Variable

I’m trying to take a column and pipe it through an echo command. If possible, I would like to keep it in one line or do this as efficiently as possible. While researching, I found that I have to use single quotes to expand the variable and to escape the double quotes. Here’s what I was trying: But…