Search Results

Search: Posts Made By: apmcd47
6,462
Posted By RudiC
Redirection works identical for input as well as...
Redirection works identical for input as well as for output. Try
$ mv /tmp/new_file /tmp/old_file
$ while read product id features
do printf "${product}, %s\n" ${features%#*}
done <...
10,615
Posted By MadeInGermany
The following Posix options are available on many...
The following Posix options are available on many OS:
ps -p <pid> -o stime=
But the format of stime is not standardized.
Better is the elapsed time
ps -p <pid> -o etime=
where the format is...
3,020
Posted By foad
Using external programs (such as cut,...
Using external programs (such as cut, *grep,sed,awk or others) are a dire waste of precious resources as well as processes.







It is not clear what the two revs should accomplish, except...
Forum: Programming 11-12-2019
20,769
Posted By jim mcnamara
The problem relates to memory management. The OS...
The problem relates to memory management. The OS sets an "end point" and a "start point" for a process working set (memory) when the process begins.

There are flavors of the malloc (also realloc)...
78,860
Posted By stomp
[TIP] Processing YAML files with yq
After the success of the jq - tool for parsing and manipulating JSON-Data someone wrote a tool called yq, which aims to be the same for YAML, what jq is for JSON. Seems to work fine. I'll definitely...
21,015
Posted By Chubler_XL
Nice wisecracker. This method would rap up into...
Nice wisecracker. This method would rap up into a fun little bash sum function:

function sum
{
local word exp var

[[ "$1" = *= ]] && var="-v ${1%=}" && shift

for word in "$@"
...
21,015
Posted By wisecracker
I am assuming you are using bash or perhaps a...
I am assuming you are using bash or perhaps a POSIX shell like dash.
Your error is telling you that it is not possible to do such a task as these shells have INTEGER arithmetic only.

If you need...
6,355
Posted By RudiC
How far would find . -printf "%T@ %p\n" | sort...
How far would
find . -printf "%T@ %p\n" | sort -r
get you?
12,799
Posted By stomp
tar (child): compress: Cannot exec: No such file...
tar (child): compress: Cannot exec: No such file or directory

As the slightly irritating message states: the compress utility is not found. You have to install it.

In Ubuntu the corresponding...
2,498
Posted By MadeInGermany
Untested: awk '{store=(store ORS $0)} /BEGIN/...
Untested:
awk '{store=(store ORS $0)} /BEGIN/ {store=$0} /END/ && store ~ /KSH is awesome/ {print store}' MyFileName
One store variable -> can be done with sed and its hold space.
sed -n 'H;...
57,531
Posted By stomp
For simple JSON tasks jq is a versatile tool for...
For simple JSON tasks jq is a versatile tool for querying, manipulating and creating JSON within a Shell script. You'll find a lot of usage examples in the web and of course in the excellent jq...
3,898
Posted By Chubler_XL
Think this should do what you describe: ...
Think this should do what you describe:

nalias() {
local fulline="$*"
local xalias=${fulline#*=}
local name=${fulline%%=*}
local pre=${name%%\**}
local i

[ "$pre" ==...
6,111
Posted By RudiC
In bash, the unloved, deprecated eval helps: ...
In bash, the unloved, deprecated eval helps:


eval echo ${src/@ctry/{$rplst\}}
source_table_nz_final source_table_usa_final source_table_uk_finaland, no, the $ and { need to be in that sequence...
Forum: Programming 08-08-2019
15,224
Posted By jim mcnamara
Banging the metal - Some Solaris 10 & 11...
Banging the metal -

Some Solaris 10 & 11 performance and system analysis code runs using perl interfaces - Dtrace for example. Dtrace also runs on Linux, again perl is a major player.
...
Forum: Linux 07-29-2019
18,265
Posted By wisecracker
IBM Code Page 437...
Hi all...

Reference this URL:
https://www.unix.com/unix-for-beginners-questions-and-answers/282400-lower-ascii-characters.html#post303037272

Researching in google for an answer showed the...
Forum: Programming 07-25-2019
2,566
Posted By balajesuri
A more pythonic way ;) N =...
A more pythonic way ;)



N = int(input("Please enter number:"))
t = sum([int(input("Enter Numbers %d:" %i)) for i in range(1, N+1)])
print(t)
204,424
Posted By Neo
Supplementary info, from a bash-related man page:...
Supplementary info, from a bash-related man page:



See also:


https://www.unix.com/man-page/redhat/1/shopt/
https://www.unix.com/man-page/centos/1/shopt/


FWIW:

mysql> select...
11,001
Posted By Corona688
I think systemd considers it dead because the...
I think systemd considers it dead because the scripts run in background, and the foreground process quits. systemd would do its own tracking of PIDs. At the least you'd need to inform systemd what...
Forum: What is on Your Mind? 05-01-2019
7,119
Posted By jim mcnamara
I'm sure Neo knows this: Soft 404 are not...
I'm sure Neo knows this:

Soft 404 are not actual defined errors. They are usually caused by thin content - examples: an URL that finds a useless error message, or a basically empty page. Or the...
2,048
Posted By Don Cragun
As RudiC said, you can use characters other than...
As RudiC said, you can use characters other than "/" as the field delimiter in sed, but there are two characters that the standards say cannot be used: a <newline> character and a <null> character...
1,334
Posted By bakunin
Yes, either that or try my little introduction...
Yes, either that or try my little introduction (https://www.unix.com/shell-programming-and-scripting/280050-selection-array.html) to select.

I hope this helps.

bakunin
1,958
Posted By jim mcnamara
the spaceship operator, <=>, is a comparison...
the spaceship operator, <=>, is a comparison function, for numeric data only. It compares elements in the input array, @unsorted. The output of the sort call is written to the array @sorted. If no...
1,084
Posted By Neo
Honestly, You are better off to set up...
Honestly,

You are better off to set up password-less ssh using shared keys versus what you are attempting to do.,
5,687
Posted By RudiC
I like these ones in particular: echo...
I like these ones in particular:


echo ${array[@]//g}
john paul eore rino
echo ${array[@]//[og]}
jhn paul ere rin
3,650
Posted By MadeInGermany
In contrast to wc, grep with -l or -q option...
In contrast to wc, grep with -l or -q option stops reading the input when a match has occurred.
In this case a
grep -q . file(stop if any character is met) seems sufficient.
Because grep returns...
Showing results 1 to 25 of 51

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