Search Results

Search: Posts Made By: Scrutinizer
125
Posted By Scrutinizer
Hi, try sort -t_ -k1,3 -k4n
Hi, try
sort -t_ -k1,3 -k4n
115
Posted By Scrutinizer
Hi, .. refers to the parent directory ....
Hi,

.. refers to the parent directory
. refers to the current directory
100
Posted By Scrutinizer
Hi, there are some syntax errors in the sample...
Hi, there are some syntax errors in the sample code. Could you try this adaptation?
array=(1 2 3)
test=(Boy Girl Dog)
x=0
while [ $x -lt 3 ]
do
printf "%3s %-4s\n" "${array[x]}"...
149
Posted By Scrutinizer
Not sure what you are looking for. You could pipe...
Not sure what you are looking for. You could pipe the result into a while-read loop and use shell variables to compose your command.

jq -r '.name + ";" + .description'...
149
Posted By Scrutinizer
Try: jq -r '.description' -- It is best to...
Try: jq -r '.description'

--
It is best to put quotes around variable expansions:
echo "$vulnerabilities"

--
You do not need the intermediate step, you could also do this:
jq -r...
Forum: Programming 5 Days Ago
190
Posted By Scrutinizer
According to : Pandas' api reference...
According to : Pandas' api reference (https://pandas.pydata.org/pandas-docs/stable/reference/api/pandas.read_csv.html)

pandas.read_csv returns
DataFrame or TextParser
A comma-separated values...
228
Posted By Scrutinizer
Slightly more "traditional" way of doing this: ...
Slightly more "traditional" way of doing this:

for (( i=0; i<${#L1[@]}; i++ ))
do
printf "%s %s\n" "${L1[i]}" "${L2[i%${#L2[@]}]}"
done

or
lenL1=${#L1[@]} lenL2=${#L2[@]}
for (( i=0;...
650
Posted By Scrutinizer
Pertaining to post #1: Try: join -12 -22 -o...
Pertaining to post #1: Try:
join -12 -22 -o 1.1,2.1 <(xargs -n1 <file1) <(xargs -n1 <file2)
494
Posted By Scrutinizer
Try converting the input file to UNIX format...
Try converting the input file to UNIX format first.
It appears to be in Windows format
tr -d '\r' <file >newfile


--
or you can maybe use
dos2unix file
if available on your OS.
Forum: Shell Programming and Scripting 2 Weeks Ago
437
Posted By Scrutinizer
Hi, try double quotes: sed...
Hi, try double quotes:
sed "s/${TOKEN1}\(.*\)${TOKEN2}.*/\1/" "$INPUT1"
The curly braces for variable expansions are good practice within strings, for reasons of readability and also to prevent...
494
Posted By Scrutinizer
You would need to compare $5 and $6 to all the...
You would need to compare $5 and $6 to all the ranges in $2, $3 so you would need to put them in memory first, so a way to do it would be to read the inputfile twice, the first time to put $2, $3 in...
511
Posted By Scrutinizer
Try: sed 's/[^ ]*_\(....\)\./\1 &/' file ...
Try:
sed 's/[^ ]*_\(....\)\./\1 &/' file
-rw-r--r-- 1 360 600 94255 Jan 01 11:16 2020 file1_2020.csv
-rw-r--r-- 1 360 600 114573 Dec 29 11:10 2019 file2_2019.csv...
Forum: Shell Programming and Scripting 2 Weeks Ago
543
Posted By Scrutinizer
POSIX regular expressions (BRE/ERE) and the GNU...
POSIX regular expressions (BRE/ERE) and the GNU and BSD derivatives are the exception, rather than the norm, in that \ is not special/meta within a character class (bracket) expression.

In (I...
Forum: Shell Programming and Scripting 3 Weeks Ago
783
Posted By Scrutinizer
One could also use quotes: ...
One could also use quotes:
AnzahlUeberstunden="$(date -d "$JAHR-$MONAT-$TAG $ArbeitEnde" +%s) - $(date -d "$JAHR-$MONAT-$TAG $NormalesArbeitsEnde" +%s)"
AnzahlUeberstunden='AnzahlUeberstunden / 60'
Forum: Shell Programming and Scripting 3 Weeks Ago
783
Posted By Scrutinizer
Because it is a an arithmetic operation (you are...
Because it is a an arithmetic operation (you are trying to divide a number by 60)

Therefore you need an arithmetic expansion ( see: Shell command language: arithmetic expansions...
Forum: Shell Programming and Scripting 3 Weeks Ago
783
Posted By Scrutinizer
Try the same as de line above with $(( ... )) en...
Try the same as de line above with $(( ... )) en some corrections in the variable name..
AnzahlUeberstunden=$((AnzahlUeberstunden/60))
or
(( AnzahlUeberstunden/=60 ))
622
Posted By Scrutinizer
Then you can disregard the stuff about older...
Then you can disregard the stuff about older Linux versions, so check the difference between "free memory" and "available memory", plus the remarks by Neo and I about numerical comparisons..
776
Posted By Scrutinizer
Hi Ravinder, As long as a mv operation is...
Hi Ravinder,

As long as a mv operation is performed on the same file system - as is the case here - that should not pose a problem, since mv then only manipulates directory data: A file name is...
622
Posted By Scrutinizer
What Linux version are you using? Check the...
What Linux version are you using?
Check the difference between free memory and available memory.

With older Linux versions check the -/+ buffers/cache: line.

The buffers/cache/slab memory...
776
Posted By Scrutinizer
Note: -n (no clobber) for the mv command is...
Note: -n (no clobber) for the mv command is non-standard extension to the POSIX standard. Alternatively, try using -i for interactive use (but some systems ignore -i when used in a non-interactive...
775
Posted By Scrutinizer
Hi, the reason that the script is so slow, is...
Hi, the reason that the script is so slow, is that it is firing off 12 different sub shells per line in the input file, so that is 12 million sub shells in total, which is quite costly.
Examples of...
715
Posted By Scrutinizer
Hi, try something like: count=$( cargo build...
Hi, try something like:
count=$( cargo build 2>&1 | grep -c 'error\[' )
878
Posted By Scrutinizer
Hi MadeInGermany, Can't you use: echo_e()...
Hi MadeInGermany,

Can't you use:
echo_e() {
printf "%b\n" "$*"
}

Instead?

The use of "$*" means that this only works as long as IFS is at the default:

$ IFS=,
$ echo -e "a\nb" c d...
1,393
Posted By Scrutinizer
It appears that it has been implemented in the...
It appears that it has been implemented in the system's regex engine, but that it does not work with globbing. On Linux, in bash 4 compare:
$ touch Miraré
$ for file in M*; do if [[ $file ==...
1,393
Posted By Scrutinizer
On Solaris 10, I tried the following, using the...
On Solaris 10, I tried the following, using the POSIX compliant utilities which are in /usr/xpg[46]/bin:

$ export PATH=/usr/xpg6/bin:/usr/xpg4/bin:$PATH
$ printf "%s\n" Estrés Miraré...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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