如何在linux中覆盖变量值 [英] How to overwrite variable value in linux
问题描述
我想将变量s1的值从abc覆盖到---> [更多/ home / mohsin / Desktop / system_usage_bash_file | grep TIME | awk'BEGIN {FS =,} {print $ 3}']
但是当我回声时我在两个回声上得到abc,意味着它没有被覆盖
我尝试了什么:
#!/ bin / bash
s1 =abc
s2 =USED
echobefore
echo $ s1
s1 = more / home / mohsin / Desktop / system_usage_bash_file | grep TIME | awk'BEGIN {FS =,} {print $ 3}'
echoafter
echo $ s1
3}']
但是当我回声时我在两个回声上得到abc,意味着它没有被覆盖
我尝试过:
#!/ bin / bash
s1 =abc
s2 =USED
echobefore
echo
s1
s1 = more / home / mohsin / Desktop / system_usage_bash_file | grep TIME | awk'BEGIN {FS =,} {print
3}'
echoafter
echo
i want to overwrite value of variable s1 from "abc" to ---> [more /home/mohsin/Desktop/system_usage_bash_file | grep TIME | awk 'BEGIN {FS=","} {print $3}']
but when i echo i get "abc" on both echos,means it is not overwritten
What I have tried:
#!/bin/bash
s1="abc"
s2="USED"
echo "before"
echo $s1
s1= more /home/mohsin/Desktop/system_usage_bash_file | grep TIME | awk 'BEGIN {FS=","} {print $3}'
echo "after"
echo $s1
3}']
but when i echo i get "abc" on both echos,means it is not overwritten
What I have tried:
#!/bin/bash
s1="abc"
s2="USED"
echo "before"
echo
s1
s1= more /home/mohsin/Desktop/system_usage_bash_file | grep TIME | awk 'BEGIN {FS=","} {print
3}'
echo "after"
echo
这篇关于如何在linux中覆盖变量值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!