The Stack Overflow podcast is back! Listen to an interview with our new CEO.

New answers tagged

0

This worked for me because I needed not only to print the result in one line but also I needed to specify how it had to be separated and you can specify that with ORS ls -1 | awk '{ ORS="|"; print; }'


0

Here's a quick script that I ended up using for this purpose. It avoids the whole problem of reading and writing at the same time by creating two files, myfile and myfile.old. #!/bin/bash # Bail on error set -e # Constants DEFAULT_NUM_LINES="1000" # Usage message usage() { echo "Usage: last-lines [-n num] filename" 1>&2 echo "Options:" 1&...


0

You can use the printf() command under bash to "columnar format" your output. The %-20s means left-justify + pad the column 20 spaces, while %20s means right-justify. First="Milton" Last="Waddams" Age="38" $ printf "%-20s%-30s%-40s" ${First} ${Last} ${Age} Milton Waddams 38 There is probably a more efficient way to ...


0

To join lines two by two with a tab (which Excel should understand as a column separator) you can pipe the file through: sed -n '1~2h;2~2{H;x;s/\n/\t/;p}'


0

The output is separated by space. Probably. It depends on how you created the text file and [exactly] what you wrote into it. To find out, use the od utility (I'm assuming your use of the term "shell script" implies some flavour of Unix): $ cat f1 A B C D $ od -cx f1 0000000 A B C D \n 4120 4220 4320 440a ...


0

For people who want something like a symlink to their rrd files, the problem is that Docker seems to not support symlink but instead you can use a bind volume: docker run -d\ --name graphite\ --restart=always\ -p 80:80\ -p 2003-2004:2003-2004\ -p 2023-2024:2023-2024\ -p 8125:8125/udp\ -p 8126:8126\ --mount type=bind,source=/var/lib/collectd,target=/...


0

If you are not sure to master the command line for this operation, I suggest installing Midnight Commander, or mc, see https://midnight-commander.org/ (I am not affiliated with it, just a happy user of it). It is packaged in various Linux distributions. It is a small utility showing a graphical display (but still just with a terminal, no X/Window) of your ...


0

you can delete the '\' file name by issuing the command - rm \\ it will del


0

Issue If I'm understanding you correctly, you are using a file to check the authentication, before you reach the LDAP plugin. And this file is connecting to an LDAP, that checks (at least) 2 groups, and allows the users belonging to (either of) those two groups to authenticate. If this is the case, you could simply delegate this to pam_ldap, and configure ...


Top 50 recent answers are included