Search Results

Search: Posts Made By: Scrutinizer
151
Posted By Scrutinizer
That is because the find command produces a list...
That is because the find command produces a list of files, but wc -l turns it in just a count (number). Also the information is not being transferred to the mail command.

You could try something...
204
Posted By Scrutinizer
Try this instead: s|(.*)/|$1/.|
Try this instead:
s|(.*)/|$1/.|
204
Posted By Scrutinizer
If you use this: s/^/\./ Then the . is added...
If you use this:
s/^/\./
Then the . is added at the beginning of the path.
To add it to the last item in the path, try:
s|.*/|$0/.|
204
Posted By Scrutinizer
Hi, in order for xargs to use NUL character...
Hi,

in order for xargs to use NUL character as separator, the utility before the pipe needs to produce them.

try:

mdfind -0 -onlyin . "Note" | xargs -0 -I {} echo {}
or
tag -0 -f "Note" ....
Forum: What is on Your Mind? 2 Days Ago
263
Posted By Scrutinizer
Congratulations Victor and Ravinder! Well and...
Congratulations Victor and Ravinder! Well and truly earned, both of you in different, valuable ways. Thank you for your contributions!
156
Posted By Scrutinizer
Hi, try sort -t_ -k1,3 -k4n
Hi, try
sort -t_ -k1,3 -k4n
181
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'...
181
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...
258
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;...
692
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)
Forum: Shell Programming and Scripting 3 Weeks Ago
475
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...
529
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...
Forum: Shell Programming and Scripting 4 Weeks Ago
821
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 4 Weeks Ago
821
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...
819
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...
819
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...
811
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...
743
Posted By Scrutinizer
Hi, try something like: count=$( cargo build...
Hi, try something like:
count=$( cargo build 2>&1 | grep -c 'error\[' )
914
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,434
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,434
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é...
1,017
Posted By Scrutinizer
@ravinder, yes POSIX sort does not have a -s...
@ravinder, yes POSIX sort does not have a -s option, see:
sort (https://pubs.opengroup.org/onlinepubs/9699919799/utilities/sort.html)

but GNU sort and BSD sort do.
1,017
Posted By Scrutinizer
Hi, try: awk '/^[0-9]/{print x}1' file | ...
Hi, try:

awk '/^[0-9]/{print x}1' file |
awk '{$1=$1}1' RS= FS='\n' OFS=§ |
sort -rnk 5,5 |
tr § '\n'


Split the records with a blank line, using a digit on the first position as the...
907
Posted By Scrutinizer
This command (if you are using GNU sed): sed...
This command (if you are using GNU sed):
sed 's/^1\|[0-9]*\_STATUS/STATUS/' outputOFF_00280456_2014_TEST.txt
Means replace either :
The digit "1" on a line that starts with that digit OR
zero or...
1,326
Posted By Scrutinizer
Ah so it is the other way around? The hostname is...
Ah so it is the other way around? The hostname is always lowercase, but the path may be uppercase?

Try something like:
cd $(ls -d "$(hostname)"* "$(hostname | tr '[[:lower:]]' '[[:upper:]]')"*...
Showing results 1 to 25 of 500

 

Featured Tech Videos

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