Quantcast
Channel: Assign values or string to a variable in linux scripting - Super User
Browsing latest articles
Browse All 3 View Live

Answer by glenn jackman for Assign values or string to a variable in linux...

This is a perfect example why you should stop using the deprecated backtick syntax in bash: filename=$(basename $(grep $FILE House/paths)) See...

View Article



Answer by terdon for Assign values or string to a variable in linux scripting

In general, in BASH you save the output of commands to a variable in one of these ways: foo=$(ls /usr) or foo=`ls /usr` As for your question, if you have a file called foo.txt whose contents look like...

View Article

Assign values or string to a variable in linux scripting

I am trying to assign the output of the basename command of a file to the variable "filename". paths is a file that contains the path location, e.g /root/home/david/mynote $FILE is = mynote. grep is...

View Article
Browsing latest articles
Browse All 3 View Live




Latest Images