Hot answers tagged

3

Your script has a few issues: The error stems from the export line. You are using $SERVER as a command, and this command can not be found. What you'd like to do is to feed the string into cut: print $SERVER | cut -c1-2,5-10 | ... The line SERVER="echo `hostname`" is better written SERVER=$(hostname) The tr utility takes character ranges, so there's ...


3

By default if you just set PS1="...." then the stuff inside the quotes is evaluated at the time you set it. However if you enclose it inside ' instead then it's evaluated at display time. And it doesn't cause a subshell for $(jobs). e.g. $ PS1=' > $(jobs) > $ ' $ sleep 1000 & [1] 7541 [1] + Running sleep 1000 & $ sleep ...


2

I would use paste here. It's a nifty tool that can be used to combine files: $ paste printdirs.txt archivedirs.txt /u/lawson/law/print/lawson/tim/1 /u/lawson/law/print/archive /u/lawson/law/print/dgfinance/monday190/1 /u/lawson/law/print/archive2 As you can see above, it will print successive lines from both files, separated by tabs. The tab-...


2

Most tutorials you can find are about bash. Ksh is very good at scripting but is bad at interactive use. Use zsh (best) or bash (second-best) as a command line if you can. There are two main implementations of ksh today: the actual Korn shell ksh93, and the clone mksh (derived from the long-unmaintained pdksh). They have different key binding facilities. ...


1

My actual problem was that (in contrast to the simplified example in my question), I actually massaged the jobs output in a function, separating running from stopped jobs. This is my code for Bash: typeset runningJobs=$(jobs -r | wc -l) typeset stoppedJobs=$(jobs -s | wc -l) which I ported to Korn shell in this way: typeset runningJobs=$(jobs | grep -c '...


1

Just run your whole install script under setarch $ setarch $(uname -m) --uname-2.6 /path/to/install/script.sh Everything called in that script onwards will think you're running a 2.6 kernel.



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