Search Results

Search: Posts Made By: Khoomfire
1,890
Posted By Khoomfire
Perl: Separator
Hello all,

I'm trying to break down a file with the following format:

[section_nme]
entries
dzdf
daff

[section 2]
enries
dfln
fnljfd
.
.
..
.


I'm reading this file, using "["...
1
3,123
Posted By Khoomfire
EVal
Hi All,
I'm running some encrypted data through a script I wrote. In order to do this, I'm using eval to resolve some of my variables. At the moment, when I use eval to resolve, it strips out some...
1,657
Posted By Khoomfire
Found the solution - Eval so my script...
Found the solution - Eval

so my script becomes

count=1
for x in $(cat /etc/filename); do
eval "file_$count=$(echo $variable| awk '{print $1}')"
count=$(( $count + 1 ))
done
1,657
Posted By Khoomfire
Using a variable within a variable name
Hello all, I am currently trying to over-complicate things by doing something similar to the code below:
count=1
for x in $(cat /etc/filename); do
file_$count=$(echo $variable| awk '{print $1}')...
11,284
Posted By Khoomfire
Cheers Era
Cheers Era
11,284
Posted By Khoomfire
Just to clarify things - I have a file with all...
Just to clarify things - I have a file with all the lines ending with \n\r when viewed with od -c. However, one line ends with just \n. I'd like to insert the \r character because the file is...
11,284
Posted By Khoomfire
Era, all those help me to view the hidden...
Era, all those help me to view the hidden characters. However in this case I'd also like to insert a newline or a carriage return, that's why I need an editor that will enable me both to view and to...
11,284
Posted By Khoomfire
hidden Characters
Hello All,
I'm trying to parse through a file and display all the hidden characters, including all carriage and line returns. I usually use cat -v, but this doesn't display the carriage and line...
2,877
Posted By Khoomfire
Sorted - if [[ $a = 1 ]] || [[ $b = 2 ]] || [[...
Sorted -
if [[ $a = 1 ]] || [[ $b = 2 ]] || [[ $c = 3 ]]; then
...
2,877
Posted By Khoomfire
If with set operators
Hi guys, I'm trying to run more than one "if" condition at once. What I want is something like

if [[ $a = 1 ]] or [[ $b = 2 ]] or [[ $c = 3 ]]; then
...


I can't remember the syntax for...
1,418
Posted By Khoomfire
Perl Newbie - help!
Hi All,
newbie-ish question here. I have this script:

foreach $test (@num)
{
foreach $record (@neet)
{
if ($record =~ /$test/){
print "$record \n";
print $test;
}
}
}

For some reason,...
5,702
Posted By Khoomfire
Finally resolved. nawk -F"," -v...
Finally resolved.

nawk -F"," -v red="$random_variable" '{print $red}' $w_dir/$file_name > $w_dir/${column_name}

The double-quotes around the variable did it.
5,702
Posted By Khoomfire
I checked. There are no hidden characters. For...
I checked. There are no hidden characters. For double measure, I have re-typed that line of code (not copied and pasted). Still the same error.
5,702
Posted By Khoomfire
I'll call it a week now - it's 17:37 over here....
I'll call it a week now - it's 17:37 over here. I'll pick up again on monday.

cheers Guys
5,702
Posted By Khoomfire
Code tags??
Code tags??
5,702
Posted By Khoomfire
Hi. I just checked everyone of those variables....
Hi. I just checked everyone of those variables. Still no difference.
5,702
Posted By Khoomfire
Hey Franklin. I currently do echo the...
Hey Franklin.

I currently do echo the $random_variable variable, that is correct. I'm not sure I'm able to echo the "red" variable
5,702
Posted By Khoomfire
I tried again. nawk: can't open file {print...
I tried again.

nawk: can't open file {print red}
source line number 1
5,702
Posted By Khoomfire
When I echo $random_variable, which have done...
When I echo $random_variable, which have done while trying to troubleshoot, I get a number - 10, 11 or 13.

I have even tried running substituting the value

nawk -F"," -v red=13 '{print $red}'...
5,702
Posted By Khoomfire
Weird Awk issue
Hi All,
a bit of a weird one here. I'm trying to pass a variable into an awk command, and I keep getting an error.

I have the line

nawk -F"," -v red=$random_variable '{print $red}'...
74,755
Posted By Khoomfire
<Sigh> Vino, In a ksh script, the line ...
<Sigh> Vino,

In a ksh script, the line

echo -n "hi I'm happy"


will give the output

-n hi I'm happy
74,755
Posted By Khoomfire
Echo with ksh shell
Hi All,
I'm trying to use the "echo" command in a korn shell script, and I want it to drop the trailing newline. Now I know that with the bash shell, the "-n" flag would solve this issue. Does...
3,136
Posted By Khoomfire
Sorted! awk '{ if (( $6 == "Random" )) print...
Sorted!
awk '{ if (( $6 == "Random" )) print $0 }'

thanks y'all

Khoom
3,136
Posted By Khoomfire
Weird scenario with Awk
Guys, this one is rather odd. I've got an array of numbers, and I'm trying to select only the records with the string "Random" in the 4th column. I'm using awk in this format:

awk '{ if (( $6 -eq...
12,345
Posted By Khoomfire
getting an error near "<", $ARGV[0]) ...
getting an error near
"<", $ARGV[0])



gandp1:/global/dmz/bbssdpi/LIVE/dp1020> /tmp/support/perl_1 /global/dmz/bbssdpi/LIVE/dp1020/archive/DP-BR_124683000.xml | head
Too many arguments...
Showing results 1 to 25 of 68

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