Search Results

Search: Posts Made By: kevin298
3,873
Posted By kevin298
Im new to bash scriping and i found this expression on a bash script what does this mean.
# check host value regex='^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$' if [ "$(echo $host | grep '[A-Za-z]')" != "" ]; then if [[...
1,587
Posted By kevin298
Hi im new to bash scripting I want to know what does the regex expression do ??
# check host value regex='^([1-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])(\.([0-9]|[1-9][0-9]|1[0-9][0-9]|2[0-4][0-9]|25[0-5])){3}$' if [ "$(echo $host | grep '[A-Za-z]')" != "" ]; then if [[...
2,166
Posted By kevin298
nvm i fixed the problem last week :)
nvm i fixed the problem last week :)
2,166
Posted By kevin298
region=$(ls ~/zoneinfo|grep $1| cut -d"/" -f1 ) ...
region=$(ls ~/zoneinfo|grep $1| cut -d"/" -f1 )

with that block of code im trying to make the script search for a region that a user entered which is $1 and see if the region that user entered...
2,166
Posted By kevin298
I tried that but it won't display the error...
I tried that but it won't display the error message to the user

heres my code now

#Checking if region exist in the database
region=$(ls zoneinfo| grep "$1")
echo $region
if [[ $1 = "" ]];...
2,166
Posted By kevin298
bash error checking problems[solved]
Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted!

1. The problem statement, all variables and given/known data: I am trying to...
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 03:16 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy