linux - Parsing a variable in shell scripting -


i new shell scripting started off. have written script

 #!/bin/sh  profile_type= cat /www/data/profile.conf  echo $profile_type 

the o/p of script is

. /tmp/s_panica1.txt . /tmp/s_panica0.txt   away_def="panica1 panica0"  away_byp=0  away_sts=$((panica1+panica0-away_byp)) 

in want panica1 panica0 , 0 , store in other variable how this?

when want assign output of command variable, use dollar parenthesis syntax.

foo=$(cat /my/file) 

you can use backticks syntax.

foo=`cat /my/file` 

in script, run command cat , assign result, nothing, variable. hence output consisting of content of file, result of cat, followed empty line, result of echo empty variable.


Comments

Popular posts from this blog

ios - UICollectionView Self Sizing Cells with Auto Layout -

node.js - ldapjs - write after end error -

DOM Manipulation in Wordpress (and elsewhere) using php -