Linked Questions
10 questions linked to/from What is the general consensus on "Useless use of cat"?
41
votes
13
answers
45k
views
Convert CRLF's to line feeds on Linux
What's the best way to convert CRLF's to line feeds in files on Linux?
I've seen sed commands, but is there anything simpler?
5
votes
3
answers
1k
views
Is it wasteful to call cat?
I’m sorry if this question is really stupid, but this is basically what I have been thinking about constantly. Suppose I run:
: cat ./somefile.txt
A few hundred times a second. How much faster is my ...
14
votes
4
answers
17k
views
Running mysql dump in a cron job without exposing passwords
I want to run
mysqldump -u aUser -p P4SSw0rd --all-databases > backup.sql
in a cron job. How can I do so securely?
I know I could put the command right there, but anyone with access to the ...
15
votes
1
answer
5k
views
Is backwards redirection the same as a pipe?
In Linux if you type
sort < txtfile
is that the same thing as
cat txtfile | sort
1
vote
2
answers
3k
views
bash script:echo output garbled and in wrong order
I am having an issue with a bash script that is echoing output in an unexpected order. The script is as follows. The problem is with the output of lines 30-32.
1 IFS=$'\n'
2 i=1
3 bluered=""
4 ...
3
votes
1
answer
1k
views
sed Error sed: -e expression #1, char 7: unterminated `s' command
I keep switching between my command prompt and my git bash shell on windows 10. Suppose I copied my current directory to the clipboard in my command prompt(cmd.exe) and want to switch to that ...
-1
votes
1
answer
1k
views
How to use HTML markup tags inside Bash script
I have crontab and a simple bash script that sends me emails every often containing PHP, NGINX, MYSQL errors from their log files. This is a simplified example.
#/home/user/status.sh
EMAIL=me@domain....
1
vote
1
answer
654
views
xargs run bash script with threads (2 arguments)
I have a file in the following format:
"192.168.2.1" "80"
"172.16.1.1" "443"
"10.1.1.1" "8080"
which contains multiple local IPs and i'm trying to run a script with threads using xargs to execute ...
4
votes
1
answer
229
views
Using grep on URLs not working
I've got a couple of text files (a.txt and b.txt) containing a bunch of URLs, each on a separate line. Think of these files as blacklists. I want to sanitize my c.txt file, scrubbing it of any of the ...
0
votes
2
answers
76
views
Search file for specific string and remove it
I have following file:
./foldername/company_users_policies_changes.txt
"terraform_automated_python","AdministratorAccess"
./foldername/company_groups_policies.txt
"terraform_automated_python","...