Search Results

Search: Posts Made By: ymc1g11
6,545
Posted By Corona688
You don't get shell variables outside of the...
You don't get shell variables outside of the shell, and awk is not a shell extension. awk is its own, independent, self-contained language.

If you want to insert a variable into awk, you can do...
6,545
Posted By Corona688
No, like I showed you: awk -v var="$var" ......
No, like I showed you:

awk -v var="$var" ...

Where the ... is everything else you were putting into awk.

awk -v num="$num" 'BEGIN { FS="." } { printf "%s %s %s\n", $1, $0, num }'
4,439
Posted By Scrutinizer
Do not post classroom or homework problems in the...
Do not post classroom or homework problems in the main forums. Homework and coursework questions can only be posted in this forum (https://www.unix.com/homework-coursework-questions/) under special...
4,439
Posted By Corona688
Try escaping the $ with \$ If no luck, try a...
Try escaping the $ with \$

If no luck, try a shell which allows proper escaping like bourne.
174,890
Posted By Amit_Chopra
foreach loop in csh
Hi,

May i know where u have defined/mentioned the directory where u want to do/run ls.
foreach x ( ls )
echo $x
end
174,890
Posted By xbin
foreach x ( * ) echo $x end or ...
foreach x ( * )
echo $x
end

or

foreach x ( `ls` )
echo $x
end
Showing results 1 to 6 of 6

 
All times are GMT -4. The time now is 12:00 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy