This forum has been archived. All content is frozen. Please use KDE Discuss instead.

kate bash alias

Tags: None
(comma "," separated)
kanttu
Registered Member
Posts
1
Karma
0

kate bash alias

Wed Oct 29, 2008 9:46 pm
This is barely a KDE tip/trick but I find it useful. Many times I like to launch kate from command line and want it to go background and stop polluting my terminal.

I don't know if there is a better way to do this. I have seen some people having alias
Code: Select all
kate='kate 2>/dev/null &'
but that didn't work for me when I want to have arguments like $ kate file.txt

What I did was add the following line to ~/.bashrc
Code: Select all
kate () { /home/kanttu/bin/kate.sh "$*"; }


Then made a script /home/kanttu/bin/kate.sh which launches kate in background and dumps the stdout to /dev/null

Code: Select all
#!/bin/bash
/usr/bin/kate -u $1 &>/dev/null &
exit


I still think there a room for improvements.
User avatar
vbatts
Registered Member
Posts
102
Karma
0
OS

RE: kate bash alias

Sat May 30, 2009 8:29 pm
kanttu wrote:This is barely a KDE tip/trick but I find it useful. Many times I like to launch kate from command line and want it to go background and stop polluting my terminal.

I don't know if there is a better way to do this. I have seen some people having alias
Code: Select all
kate='kate 2>/dev/null &'
but that didn't work for me when I want to have arguments like $ kate file.txt

What I did was add the following line to ~/.bashrc
Code: Select all
kate () { /home/kanttu/bin/kate.sh "$*"; }


Then made a script /home/kanttu/bin/kate.sh which launches kate in background and dumps the stdout to /dev/null

Code: Select all
#!/bin/bash
/usr/bin/kate -u $1 &>/dev/null &
exit


I still think there a room for improvements.


a bash function or alias is all you need
either
Code: Select all
 alias kate='kate ${1+"$@"} 2> /dev/null > /dev/null'

or
Code: Select all
function kate() { kate ${1+"$@"} 2> /dev/null > /dev/null }


hope this helps


vbatts, proud to be a member of KDE forums since 2008-Sep.

http://hashbangbash.com/
vahid
Registered Member
Posts
32
Karma
0

RE: kate bash alias

Wed Jun 24, 2009 9:15 am
nohup kate
nohup: ignoring input and appending output to `nohup.out'
^C
nutter@muttley:~$ nohup kate&
nohup: ignoring input and appending output to `nohup.out'
[1] 4069


easy :)


Bookmarks



Who is online

Registered users: Bing [Bot], Evergrowing, Google [Bot]