Search Results

Search: Posts Made By: max_hammer
1,401
Posted By max_hammer
Try searching ...
Try searching


https://www.unix.com/answers-frequently-asked-questions/13785-yesterdays-date-date-arithmetic.html
3,685
Posted By max_hammer
Its working for me you can try this ...
Its working for me

you can try this


$ echo "hello:myde:temp:stiker" | cut -d: -f2,4 | tr ':' '-'
myde-stiker
3,362
Posted By max_hammer
try this ls -ltr...
try this


ls -ltr /root/admin/files/file* | head -1 | awk -F "/" '{print $NF}'


here i have set the field seprator as "/" awk -F "/" and $NF means last field
5,099
Posted By max_hammer
if [ "${ch}" -eq "3" -o "${ch}" -eq "4" ] ...
if [ "${ch}" -eq "3" -o "${ch}" -eq "4" ]


Should be


if [ "${ch}" = "3" -o "${ch}" = "4" ]

OR

if [ ${ch} -eq 3 -o ${ch} -eq 4 ]


= for comparing string
-eq for numbers
1,897
Posted By max_hammer
#! /bin/ksh set -A array1 11 12 13 14 15 set...
#! /bin/ksh
set -A array1 11 12 13 14 15
set -A array2 abc def ghi ijk lmn
i=0
while [ $i -ne ${#array1
} ]
do
echo " Hello ${array1[i]} ${array2[i]}"
(( i = i + 1 ))
done

...
2,237
Posted By max_hammer
echo "this is a test line." | sed...
echo "this is a test line." | sed 's/[a-z][a-z]*/"&",/g'
"this", "is", "a", "test", "line",.
2,042
Posted By max_hammer
try this #/bin/ksh set -A row `head -1...
try this
#/bin/ksh
set -A row `head -1 file.txt`
num_col=`echo ${#row
}`
i=1
while (( i <= ${num_col} ))
do
cut -d ' ' -f${i} file.txt > ${i}.dat
(( i += 1 ))
done
Showing results 1 to 7 of 7

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