New answers tagged

0 votes

Confused why pgrep cant show children of jobs started in subshell

My problem had nothing to do with pgrep. The issue was that the driver script ended before the children did so all associations were de-referenced. Adding a wait to the driver fixed my issue.
user avatar
  • 67
1 vote

Read content of file in ksh and split it by ','

If your ksh is ksh93 or mksh, you could read the first line into an array with: IFS=, read -rA array < file.txt Also works in zsh or yash. For some reason, bash, years later, chose to use -a ...
user avatar
0 votes

Concatenate files with same structure, keeping header only for 1st file

How about awk 'NR==1 || FNR > 1' $(< input.txt ) Don't quote the "command substitution" so it produces a list of file names on awk's command line (up to the LINE_MAX system config ...
user avatar
  • 8,565
0 votes

Concatenate files with same structure, keeping header only for 1st file

This solution assumes that the list of files is potentially longer than what could be handled by a single invocation of some external command (so the filenames in input.txt can't be listed on the ...
user avatar
  • 271k
3 votes
Accepted

Call a command from a shell script, passing most arguments, allowing arguments with blanks

First, use "$@" instead of $* (or $@) to keep the arguments intact. It expands each argument as a separate word, as if you used "$1" "$2"... Note that with $*, glob ...
user avatar
  • 116k
0 votes

Concatenate files with same structure, keeping header only for 1st file

You can use a variety of tools for this job. I assume that you want to keep the first header and get rid of the other ones. So it is just a matter of appending to the untouched first file, while ...
user avatar
  • 2,288

Top 50 recent answers are included