Artificial intelligent assistant

How to echo in shell script without executing the result I am using this code to print all open files in the specified changelist. while read line; do echo "$line" done < `p4 opened -c $changelist` However, the line also gets executed and I get following error: ./do.sh: line 7: //perforce/a.js#24 - edit change 353 (text) by user1: No such file or directory My required output is: //perforce/a.js#24 - edit change 353 (text) by user1

With bash, zsh and ksh _ProcessSubstitution_ :


while IFS= read -r line; do
echo "$line"
done < <(p4 opened -c $changelist)


See < and <

If not using one of these shells (like Joseph R. said in comments), use a simple pipe :


p4 opened -c $changelist | while IFS= read -r line; do
echo "$line"
done

xcX3v84RxoQ-4GxG32940ukFUIEgYdPy 7e2ff83f082074244360872923da4785