Hot answers tagged

2

It's not about sed, it's about the shell. ${meta.app} is almost like the syntax for the parameter substitution (other names: variable substitution, variable expansion): ${var}. Variable names cannot contain dots. There is syntax like ${var-foo} where - does not belong to the name either, there are more of them; but ${var.foo} or ${meta.app} is not defined. ...


2

The issue has nothing to do with nohup. Brace expansion is a bashism. Your code runs sh which does not expand {0..9}. Use bash instead of sh. If you still want to use sh, then for i in $(seq 0 9); do …. (Almost always one should double-quote $(), but in this case not quoting is the right thing.)


2

source is an internal/built-in command in bash. A builtin is a command contained within the Bash tool set, literally built in. This is either for performance reasons -- builtins execute faster than external commands, which usually require forking off [1] a separate process -- or because a particular builtin needs direct access to the shell internals. ...


2

As you say,C-x @ is used for possible-hostname-completions. If you look this up in the bash manual link you provided, it's in the section "Letting Readline Type For You". Readline is a library that allows line editing and other things like tab completion. It's used in bash, but also in other programs. So readline inside bash, with a particular ...


1

"${@/#/$d}" is expanded by Bash in the following way: @ refers to the parameter array, so if you call a function foo like foo "a b" c then the parameter array has two entries a b and c. "${varname/pattern/replacement}" (pattern substitution) replaces the first instance of pattern in the variable varname with replacement. # in a ...


1

Move the binary to a location that is not in the $PATH Create a bash script to do the verification that you want and store it at a location inside your path. mv /sbin/shutdown /opt/shutdown touch /sbin/shutdown chmod +x /sbin/shutdown Then replace it with a bash script that does what you want. #!/bin/bash echo "do whatever" /opt/shutdown $@ The ...


1

You will probably need to install qpdf. Here's a quick attempt at a script. #!/bin/bash pdffile="$1" # Find the nuber of pages in the document qty=$(pdfinfo "$pdffile" | grep Pages | awk '{print $2}') i=1 # first page for the file j=500 # last page for the file if [ $j -gt $qty ] ; then echo "File is already smaller ...


1

I think the script utility should address your needs: It captures terminal I/O to a file. It is part of most Linuxes and Unixes by default, here's the start of its man page: NAME script - make typescript of terminal session SYNOPSIS script [options] [file] DESCRIPTION script makes a typescript of everything displayed on your ter‐ minal. It is ...


Only top voted, non community-wiki answers of a minimum length are eligible