Tag Info

Hot answers tagged

1

Split doesn't support suffix for output file names. AFAIK it supports only prefix. For text files, you could try awk: awk 'NR%25==1 { i+=1;file = "/home/ubuntu/PL/trab3/rc" "_" sprintf("%02d", i) } { print > file }' /etc/adduser.conf


1

With older gnome-shell versions (prior to 3.8 or 3.10, I'm not sure): disable: gsettings set org.gnome.desktop.notifications enable false enable: gsettings set org.gnome.desktop.notifications enable true With newer gnome-shell versions: disable: gsettings set org.gnome.desktop.notifications show-banners false enable: gsettings set ...


1

Depending on how complicated your use-case actually is, you can set and/or change a variable for just one command by prefixing the command with the variable's value. For example, 1 prompt> X=1 2 prompt> X=2 some_command arg1 arg2 3 prompt> echo $X the variable X will be 2 inside some_command, but returned back to X=1 on line 3. So you could ...


1

In bash, you can accomplish >/dev/null 2>&1 with &>/dev/null. You could do something like: #Run a command in the background, ignoring its STDOUT and STDERR silence() { local cmd="$1"; shift; "$cmd" "$@" &>/dev/null & } #The same, but stop caring about it too (no job control, no SIGHUP when the parent terminal closes) abandon() ...


1

Short answer: M-x terminal-emulator sounds exactly like what you're asking for. What you need might be different - if you really just need to give the program a series of y lines on stdin, consider yes | program. If the program really wants its stdin to be a tty, consider using expect.


1

On most OS's this is done with redirect commands, almost always these are > to over-write any existing file, or >> to append to a file. Lookup pipes and redirects for more info. Not a Mac expert but since MacOS is largely unix these days I imagine it will be the same.



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