Skip to main content

All Questions

Tagged with
2 votes
1 answer
212 views

cat files based on substring match

I have file names in the following format and I would like to cat files based on substring match(Orange,Apple) and a constant(S4,S5), file names example _S6_trimmed_, _S8_trimmed_, _S9_trimmed_, ...
user1967473's user avatar
2 votes
0 answers
44 views

Cat with gun parallel does not continue as expected

Here is my code. file_name="all_parts" find parts/ -type f > ${file_name} while read part do echo processing ${part} cat ${part} | parallel -j 100 'wget {} -o logs/...
Jon Xu's user avatar
  • 21
0 votes
1 answer
83 views

Set default editor [duplicate]

I would like to configure a program named howdy which allows you to login using your face. For this I need to edit the config file to add the path to my camera. However when I execute sudo howdy ...
TheFibonacciEffect's user avatar
2 votes
1 answer
1k views

concatening a variable to a file using cat

I wanted to do a bash function that given a text variable, it would concatenate it to a file. i.e function print() { cat << 'EOF' >> file This $1 is a variable EOF } But it wouldnt work. ...
Valku's user avatar
  • 23
0 votes
1 answer
33 views

How to add a counter starting from a number other than 1?

I have a file where I need to add 200 more lines, but I'd like to know how to renumber them automatically. The file has the following structure: col1\tcol2\tdb4444\tcol4\tcol5\tcol6\tcol7\tcol8\tcol9\...
Primo's user avatar
  • 11
6 votes
1 answer
3k views

Cat hangs when attempting to read empty STDIN

My script attempts to gather information that may or may not be present in STDIN at execution time, but cat hangs if the pipe is empty. How can I ensure that my script skips this step if this there is ...
StarCrashr's user avatar
1 vote
2 answers
6k views

select columns on cat command

I use a file as a little db table. The content is like this: client1 john doe engineer cal client2 jane doe nurse ny client3 ali veli doctor ny I want to find ...
Jo Shepherd's user avatar
1 vote
1 answer
16k views

cat command with a variable that has spaces

I need to use cat command to display the contents of a file, and the filename has spaces in them: "embedded board link.rtf". I assign the filename using a variable: I="embedded board link.rtf", but ...
prosseek's user avatar
  • 5,974
7 votes
7 answers
10k views

What is the equivalent of Bash's cat -n in PowerShell?

I want to cat a file and output the line number of each line it outputs. However, in PowerShell, cat outputs an array. Hence the question effectively becomes: How do I print the index of each item ...
deostroll's user avatar
  • 1,815
1 vote
1 answer
597 views

echo stdin, unless empty, in which case cat a file

The pipeline fstdraw in.fst | dot -Tpng | convert - -rotate 90 out.png converts a file in a certain binary format into a PNG image. Unfortunately, in some cases fstdraw emits zero bytes. (A bug in ...
Camille Goudeseune's user avatar
4 votes
2 answers
11k views

Piping commands into nc

I've seemingly searched many very similar questions but never quite found something to work. I'm trying to use a raspberry pi (2nd gen) to communicate with a Wifi OBDII sensor. I'm able to use the ...
Markysm's user avatar
  • 41
1 vote
1 answer
460 views

cat files from pipe

I have to join files to one original file, which was split. There is a catalog, in which there are a lot of files,but no every is necessary. I have file with md5sum, which contain md5sum files I have ...
diego9403's user avatar
  • 907
0 votes
1 answer
311 views

/usr/bin/mail not interpreting new lines

I have a strange problem when piping a cat to mail. I have a simple text file which has been compiled from a script, which is a report on what folders were copied in the script. I then want to send ...
Andy Foster's user avatar
0 votes
2 answers
2k views

What's the behaviour of `cat | less`?

I tried to run the following command: cat | less I know both commands require something from the standard input. When I run it that's what I expected: all my inputs goes to cat and I will not be ...
user1833218's user avatar
0 votes
1 answer
643 views

Piping a line of the file read with while read loop

I am trying to read each line of the file and then assign some parts of it to variables. A line itself is read as a variable so I need to process a variable input say for cat which seems to be ...
Jargal's user avatar
  • 1

15 30 50 per page