47,584 questions
7
votes
1
answer
11k
views
undefined reference to omp_get_thread_num using OpenMP and cmake?
I am using a large code-base that compiled successfully before using make with a makefile and cmake. However, now that I'm trying to use openmp with it, I'm now getting the errors
undefined reference ...
177
votes
17
answers
141k
views
Is there a way to ignore header lines in a UNIX sort?
I have a fixed-width-field file which I'm trying to sort using the UNIX (Cygwin, in my case) sort utility.
The problem is there is a two-line header at the top of the file which is being sorted to the ...
14
votes
6
answers
91k
views
Automatically solve rm cannot remove path : device or resource busy error
I am trying to remove a directory /path/to/dir using the rm -rf command.
Unfortunately I get the error
rm: cannot remove '/path/to/dir/.nfsdda293a660f276ca0000000a': Device or resource busy
After a ...
2
votes
1
answer
105
views
Update z/OS Password Using PHP cURL Module
I'm trying to change a password on a z/OS mainframe that I make an FTPS connection to. Working with a legacy codebase and I'm trying to get rid of the exec calls to cURL. You'll notice all the ...
-1
votes
8
answers
34k
views
Write a shell script to find the largest among three numbers. Get user inputs and display the result
Write a shell script to find the largest among three numbers. Get user inputs and display the result.
Sample input 1:
10
20
30
Sample output 1:
30 is largest number
Sample input 2:
10
10
10
Sample ...
701
votes
7
answers
336k
views
What is the difference between "#!/usr/bin/env bash" and "#!/usr/bin/bash"?
In the header of a Bash script, what's the difference between those two statements:
#!/usr/bin/env bash
#!/usr/bin/bash
When I consulted the env man page, I get this definition:
env - run a program ...
1
vote
3
answers
23k
views
How to connect Database and run query inside a shell script?
I am trying to connect to DB from a shell script, but I am getting below errors for this.
Database output: ERROR:
ORA-12154: TNS:could not resolve the connect identifier specified
SP2-0306: Invalid ...
2
votes
1
answer
608
views
convert recursive mac os 9 line endings
I have been having very strange issues with line endings.
I have just noticed that in Sublime Text the view/line endings shows them up as Mac OS9.
How can I convert the whole directory recursively ...
210
votes
13
answers
248k
views
unix diff side-to-side results?
How can I plot the results of a unix diff command side-to-side instead of one difference after the other? See below for an example:
diff /tmp/test1 /tmp/test2
1,4c1,2
< asfdsadf
< ...
0
votes
0
answers
51
views
RPC communications in Mattermost plugins and Apache-APISIX plugins, Is RPC only for Golang - Golang?
I’m trying to understand how plugin systems differ between Mattermost and Apache APISIX, specifically in how they use RPC for external plugins.
Mattermost plugins must be written in Go. The server ...
44
votes
7
answers
40k
views
Why using dirname in find command gives dots for each match?
I'm using find for a task and I noticed that when I do something like this:
find `pwd` -name "file.ext" -exec echo $(dirname {}) \;
it will give you dots only for each match. When you substitute ...
4
votes
5
answers
8k
views
Rename a file but keeping the orginal creation, modification time in UNIX
Is there any way to rename a file while keeping the original creation / modification/ read time?
This is in Solaris.
355
votes
29
answers
367k
views
Rename multiple files based on pattern in Unix
There are multiple files in a directory that begin with prefix fgh, for example:
fghfilea
fghfileb
fghfilec
I want to rename all of them to begin with prefix jkl. Is there a single command to do that ...
476
votes
26
answers
690k
views
How to convert DOS/Windows newline (CRLF) to Unix newline (LF)
How can I programmatically (not using vi) convert DOS/Windows newlines to Unix newlines?
The dos2unix and unix2dos commands are not available on certain systems.
How can I emulate them with commands ...
2
votes
2
answers
13k
views
TNS entries in Linux
I have to update TNS entries in a Linux server. I am trying to search tnsname.ora file but unable to.
"locate tnsname.ora" is not giving me any result."find $ORACLE_HOME -name tnsnames.ora" is also ...