নিম্নলিখিত ফাইলগুলির সাথে আমি কয়েকটি প্রাক-সংজ্ঞায়িত পাঠ্য লিখতে চাই:
text="this is line one\n
this is line two\n
this is line three"
echo -e $text > filename
আমি এরকম কিছু প্রত্যাশা করছি:
this is line one
this is line two
this is line three
তবে এটি পেয়েছি:
this is line one
this is line two
this is line three
আমি ইতিবাচক যে প্রত্যেকের পরে কোনও স্থান নেই \n, তবে কীভাবে অতিরিক্ত স্থান বের হয়?
\nপ্রতিটি লাইনের
\nকেন নতুন লাইনে পরের লাইনটি রেখেছেন? সহজভাবেtext="this is line one\nthis is line two\nthis is line three"
\nপ্রতিটি লাইনের শেষে অপসারণের ফলে আউটপুট একসাথে একক লাইনে চলে যায়।
"$text"প্রতিধ্বনি রেখার চারপাশে ডাবল কোট লাগানো অত্যন্ত গুরুত্বপূর্ণ। এগুলি ব্যতীত নতুন লাইনের কোনওটিই (আক্ষরিক এবং '\ n') কাজ করে না। তাদের সাথে, তারা সবাই করে।
text="this is line one\nthis is line two\nthis is line three"একই লাইনে টাইপ করেন ..? (কোনও প্রবেশ ছাড়াই)