Search
 
SCRIPT & CODE EXAMPLE
 

SHELL

bash split string into variables

# separator is space
VAR="inforge srl bergamo"
read -r ONE TWO THREE <<< "${VAR}"
echo ${ONE}
echo ${TWO}
echo ${THREE}

# separator is comma
VAR="inforge,srl,bergamo"
IFS="," read -r ONE TWO THREE <<< "${VAR}"
echo "${ONE} ${TWO} ${THREE}"
Comment

PREVIOUS NEXT
Code Example
Shell :: ubuntu check chmod 
Shell :: my shell bash scripting practice 
Shell :: how to kill a process with linux 
Shell :: # Check failed: allocator-SetPermissions(reinterpret_cast<void*(region.begin()), region.size(), PageAllocator::kNoAccess). 
Shell :: recursive chown 
Shell :: to import sass files you first need to install node-sass. react 
Shell :: linux external hard drive chmod 
Shell :: How to find information about my RAM on linux 
Shell :: git stash apply undo merge conflict 
Shell :: update linux ubuntu 
Shell :: could not find driver postgres laravel 
Shell :: ERROR: Could not build wheels for backports.zoneinfo, which is required to install pyproject.toml-based projects 
Shell :: windows edit file cmdp 
Shell :: edit crontab daily 
Shell :: linux Could not find a version that satisfies the requirement 
Shell :: linux commad to show directories 
Shell :: updating all python modules 
Shell :: print colored text bash 
Shell :: remove migration 
Shell :: create strapi app 
Shell :: best shell linux 
Shell :: scp HostKeyVerification=false 
Shell :: windows 10 sfc scan 
Shell :: set java home path 
Shell :: clear teams cache powershell 
Shell :: switch installed linx to wsl2 
Shell :: certbot configure 
Shell :: Push a New Branch To Remote Repository in git command 
Shell :: brave install in linux 
Shell :: linux mount nfs share 
ADD CONTENT
Topic
Content
Source link
Name
7+3 =