LinuxQuestions.org
Latest LQ Deal: Linux Power User Bundle
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 08-16-2010, 03:16 PM   #1
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 6
Posts: 195

Rep: Reputation: 22
nice can't cd?


I updated my CentOS system and suddenly nice can't cd.

nice -n -18 cd orangebox/ && ./srcds_run -game cstrike -ip 111.111.111.111 -port 27015 -maxplayers 15 -tickrate 66 +fps_max 550 +map de_dust2 +servercfgfile server.cfg +tv_enable 1 +tv_maxclients 15 +tv_port 27020

nice: cd: Permission denied
if I run it as su I get:
nice: cd: No such file or directory


This syntax used to work.
 
Old 08-16-2010, 03:45 PM   #2
AlucardZero
Senior Member
 
Registered: May 2006
Location: USA
Distribution: Debian
Posts: 4,808

Rep: Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604Reputation: 604
Quote:
This syntax used to work.
Ummmm, are you sure? "cd" is a shell builtin. You can't nice shell builtins (or do some other things with them). So you must have been doing it differently, or doing something else.

nice the srcds_run command instead.
 
Old 08-17-2010, 08:28 AM   #3
deathsfriend99
Member
 
Registered: Nov 2007
Distribution: CentOS 6
Posts: 195

Original Poster
Rep: Reputation: 22
Yes, you're right. The startup command changed. I didn't used to have to cd to orangebox in order to srcds_run, but steam has changed the directory structure on Couter-Strike: Source.
 
Old 08-17-2010, 08:49 AM   #4
nuwen52
Member
 
Registered: Feb 2009
Distribution: Debian, CentOS 5, Gentoo, FreeBSD, Fedora, Mint, Slackware64
Posts: 208

Rep: Reputation: 46
I don't know if this will work, but you could try encasing the commands in a shell, like:
Code:
nice -n -18 sh -c "cd /tmp;touch this_file.txt"
 
Old 08-17-2010, 09:43 AM   #5
i92guboj
Gentoo support team
 
Registered: May 2008
Location: Lucena, Córdoba (Spain)
Distribution: Gentoo
Posts: 4,063

Rep: Reputation: 381Reputation: 381Reputation: 381Reputation: 381
I don't get the point of nice'ing "cd" at all (because that's what you are doing). '&&' is a shell control operator and it is catch by your shell, it is not interpreted by nice (in fact, it doesn't even reach nice at all, in case that was your intention). Maybe you meant this instead:

Code:
cd foo && nice -n -18 ./srcds_run <whatever_else>
Or even:

Code:
nice sh -c 'cd /foo && ./srcds_run <whatever_else>
But, as said, niceing cd is completely irrelevant, it's an instantaneous command that just runs and gets you into a directory, it's not like it'll be running for two hours or wasting cpu time at all.....
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Nice to see you again! harken General 2 02-03-2010 08:51 AM
nice -20 and nice +20 graziano1968 Linux - General 2 04-23-2008 01:04 PM
Hello all - nice to be here. the_future LinuxQuestions.org Member Intro 1 04-18-2006 04:26 PM
Google has been nice to my site. Is it nice to your site? Travis86 General 5 08-31-2003 02:38 PM
Nice and confused about nice Hangdog42 Linux - General 5 06-03-2003 05:44 PM


All times are GMT -5. The time now is 06:42 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration