Search Results

Search: Posts Made By: juzz4fun
1,098
Posted By Just Ice
sh, bash and ksh sets variables with just the "="...
sh, bash and ksh sets variables with just the "=" sign (i.e., aa=boo) while csh and tcsh sets variables with set at the beginning of the line (i.e., set aa = boo) ...

variables are usually local...
1,098
Posted By bakunin
I suggest you read the man page of the shell...
I suggest you read the man page of the shell which you didin't tell us any specifics about.

"export" is not an assignment, it just marks an already assigned vaiabl for export when a new shell...
22,319
Posted By Corona688
Just so. Some versions of csh have bugs related...
Just so. Some versions of csh have bugs related to it. The ad-hoc parser strikes again.
22,319
Posted By MadeInGermany
You were hit by a parser bug: echo a\ b\ c ...
You were hit by a parser bug:
echo a\
b\
c
a b cecho `echo a\
b\
c`
a
the next lines are not appended and missing in the output.
The bug is fixed in recent versions of tcsh.

BTW if you...
22,319
Posted By alister
I have never worked with any csh variant, but, at...
I have never worked with any csh variant, but, at least with some implementations, you can get trace data if you set the echo and verbose variables (set echo verbose). Seeing the commands before and...
1,386
Posted By Corona688
If you login to a local terminal, you talk to...
If you login to a local terminal, you talk to /bin/login, if you login with sshd it goes its own way, but these days everything talks to the same login system -- pam. (pluggable authentication...
2,154
Posted By pamu
Any numerical operation to that field will make...
Any numerical operation to that field will make it numerical.

You can also do this by *1, /1 like :)
Just careful with the strings. String will become 0

pamu
3,082
Posted By Don Cragun
I'm surprised this works for you. If nofields...
I'm surprised this works for you. If nofields contains:
1
3
5and input contains:
1 2 3 4 5
1 2 3 4 5 6 7
1 2 3 4
1
1 2
1 2 3the output I get is:
2 4 2 4 6 7
2 4
2
2 where the first two...
3,082
Posted By Yoda
Replace if(i not in a ) with if ( ! ( i in a ) )
Replace if(i not in a ) with if ( ! ( i in a ) )
2,116
Posted By Yoda
Using awk awk '{$1=$1}1' file
Using awk
awk '{$1=$1}1' file
24,941
Posted By Yoda
You can set colsep to comma to generate a CSV...
You can set colsep to comma to generate a CSV output:
set colsep ,
24,941
Posted By jim mcnamara
sqlplus -s $AIM_PSWD << EOF > sql.out set...
sqlplus -s $AIM_PSWD << EOF > sql.out
set feed off
set head off
set pages 0
select * from <table>
where <condition>;
EOF

try that.
4,378
Posted By Yoda
I don't think this is the best way for handling...
I don't think this is the best way for handling this task.

I would suggest using SQL Loader (http://docs.oracle.com/cd/B19306_01/server.102/b14215/ldr_concepts.htm) for loading your colon...
803
Posted By joeyg
Upon further review...
Disregard my previous post.

-r FileName tells if FileName is readable by the current process.

you can man test
to learn more.

So, you will see those if both files are readable (you have...
3,761
Posted By Yoda
Using perl is one option: perl -e 'use POSIX...
Using perl is one option:
perl -e 'use POSIX qw(strftime); print strftime "%y%m%d",localtime(time()- 3600*72);'
Or you can use Perderabo's datecalc script in the thread that I posted.
1,084
Posted By Yoda
I really don't understand what you are trying to...
I really don't understand what you are trying to achieve!

But you can define the file names in a variable inside BEGIN block and do something like below to get your desired output:
awk...
2,471
Posted By Yoda
@juzz4fun, if you are using a for loop, then...
@juzz4fun, if you are using a for loop, then there is no need to use ls command inside.

That useless of ls (http://partmaps.org/era/unix/award.html#ls) command. You can simply use the variable: i...
2,074
Posted By Don Cragun
I'm not sure I understand your question. If you...
I'm not sure I understand your question. If you man you want to move file_123 to folder_123 and instead of just removing file_, try:
#!/bin/ksh
for i in file_*
do mv "$i" "folder${i#file}"...
2,074
Posted By Don Cragun
The simple thing is to just use bash, ksh, or any...
The simple thing is to just use bash, ksh, or any other POSIX conforming shell (I used ksh for this example):
#!/bin/ksh
for i in file_*
do echo mv "$i" "${i#file_}"
done
if the commands...
2,688
Posted By zaxxon
You could print out the header directly and then...
You could print out the header directly and then just work on the rest:

$ head -1 infile; awk 'BEGIN{FS=OFS=":"} NR > 1 {$3+=1000; print}' infile| sort -t: -k3n
number:department:amount...
1,334
Posted By Scrutinizer
On Solaris use /usr/xpg4/bin/awk rather than awk ...
On Solaris use /usr/xpg4/bin/awk rather than awk

--
The script works by using the double quote as both input and output field separator.

If there are no fields with double quotes, then the...
1,810
Posted By Yoda
Here is an explanation: awk -F':' ' #...
Here is an explanation:
awk -F':' '
# NR == Total number of records read from all input file.
# FNR == Total number of records read from current input file.
# NR == FNR is...
1,810
Posted By MadeInGermany
echo "$no_x_code_list" is a list. Not nice for...
echo "$no_x_code_list" is a list.
Not nice for awk. Convert to a file format and feed that to awk.
awk reads from stdin when the filename is '-'.
echo "$no_x_code_list" | tr ' ' '\n' | awk -F':'...
1,810
Posted By Yoda
Let us say if you have list of X codes in file:...
Let us say if you have list of X codes in file: no_x_code_list

Assuming fields in your file: input_file.csv are separated by colon :, you could do something like:
awk -F':'...
Showing results 1 to 24 of 24

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