Industry guru Dave Taylor offers free tech support on technical and business topics, including iPhone, iPod, Microsoft Windows, Sony PSP, cellphones, online advertising, CSS, Web design, business, Unix, Linux, SEO, Mac OS X, and shell script programming.


Online Tech Support Starts Here!

Parsing "id" strings in a Shell Script?

Hello Dave. I need a Bash shell script that creates a directories with the group names automatically when user logs in to the system, in their home directory.

For example, user "sandy" might have the following set of groups from the 'id' command:

uid=10002(sandy) gid=119(rtkit) groups=119(rtkit),10001(admin),10003(pr007drdl)

and the directories "rtkit", "admin" and "pr007drdl" should then be created. How do I do it?

Question answered on January 19, 2012 at 08:49 AM ::

What skills do I need to be a successful system administrator?

As part of reinventing myself professionally, I want to be a system administrator with networking knowledge. I thought that was the typical thing to do, most likely something windows related with their boatloads of certifications not including experience needed to get into the work field.

I talked to someone that has been in the role of system administrator, however, and he actually pointed me in a different direction: He dissed Windows...

If I really wanted to learn something that's been around for decades with little changes, and in great demand then he said I should learn the foundation of UNIX, as everyone in the world needs a UNIX Admin. The market's saturated with sys admin in windows/help desk/supports etc. and if you wanted to work in another country, I'd have no issues with language, computer wise. And that I can work in any type of industry as UNIX is the main backbone for 90% of commercial organizations.

What do you think, Dave? What's the core skillset and training needed to be a successful system administrator in the next decade?

Question answered on April 8, 2011 at 08:14 AM :: Comments to date: 1

Mac "item in use" error when installing a new app?

Category: Mac OS X Help

I'm confused: on my Mac when I go to install new software sometimes I just drag and drop it and everything's fine, but other times I get "item in use" errors and have to reboot before I can install the new app. What's up with that?

Question answered on November 18, 2010 at 08:29 AM :: Comments to date: 0

Review: iSSH for the iPad/iPhone

If you're running an online business like I am, there are times when you need to connect and log in to the server to tweak or check things. It can't be helped and while the Cpanel solution and related are often splendid, sometimes I just like to get bits all over my hands as I "go old school" on my server and use a command line.

In those instances there's a nice solution on the Mac called "Terminal", included with Mac OS X, and there's a rudimentary terminal window app for Windows too, but once you move onto mobile devices of any nature, nothing's available.

That's why I was so interested in iSSH [iTunes link], a low-cost iPad application that lets me connect directly to my Web server via a secure, encrypted connection (SSH = secure shell, it's the secure alternative to "telnet') from my iPad and, in case of a crisis, even my iPhone.

Question answered on September 2, 2010 at 08:31 AM :: Comments to date: 8

Can I sequentially rename files in Linux?

As part of some user interface testing I'm involved with on an Ubuntu Linux system, I find myself frequently having to rename groups of files in a sequential manner. That is, I'll have files like "output mm-dd-yyyy at hh:mm:ss" and need to rename them to "testrun-xx-file-yy". Is there any way to automate this so I don't have to go crazy typing?

Question answered on June 18, 2010 at 08:16 AM :: Comments to date: 3

Why is shell script programming so fun?

Dave, can you tell me, how come I enjoy shell programming more than other types of programming (Javascript, Java or C)?

Question answered on March 9, 2010 at 08:00 AM :: Comments to date: 2

How to calculate available disk space on Linux?

Dave, I know how to check for free disk space on Windows XP, but how do I check for the amount of free disk space available on a machine running Linux (CentOS, Fedora, Red Hat, Ubuntu, etc.)?

Question answered on January 12, 2010 at 08:31 AM :: Comments to date: 1

What version of Linux am I running?

I have a Virtual Private Server or a dedicated server running Linux, but I'm not sure which version of Linux (Fedora, CentOS, Debian, etc.) the server is running. How do I find out?

Question answered on December 11, 2009 at 08:33 AM :: Comments to date: 2

How do I set my Terminal / shell PS1 prompt?

Category: Mac OS X Help

I have Mac OS X 10.5.8. When I try to change my unix shell prompt by putting the line:

  export PS1='mac> '

into my .bash_profile, the prompt is changed but the cursor is in the first column (over the "m" of my prompt) and any typing overwrites the prompt.

Question answered on October 9, 2009 at 08:47 AM :: Comments to date: 5

How can I connect to a printer in Mac OS X Snow Leopard?

Category: Mac OS X Help

I move around quite a bit as a road warrior and though I don't often need to print, sometimes being able to produce a hard copy is definitely helpful. Problem is, I don't want to bother people in different temporary offices with configuration details: I'm running Mac OS X Snow Leopard on my MacBook Pro, is there some easy way to add printers on the go?

Question answered on September 23, 2009 at 08:00 AM :: Comments to date: 1

How can I keep a compressed Linux archive up to date?

We have a situation where we need to keep a ZIP archive of some data files available on our Ubuntu Linux server so that our satellite offices can grab the information through slower data lines. Problem is, the underlying files change 2-3 times a day. What's a quick, efficient way to only rebuild the ZIP archive file on our Linux system if a file's changed, but leave it as-is if everything's stayed the same?

Question answered on August 29, 2009 at 08:32 AM :: Comments to date: 2

How can I convert map addresses into latitude longitude?

I'm trying to write a shell script that will accept a street address and output the latitude and longitude of that address, for geocache purposes. How can I do that?

Question answered on April 18, 2009 at 09:15 AM :: Comments to date: 3

How do I install Ubuntu Linux on a Netbook?

I just bought a slick ASUS Eee PC netbook, model 1000HA, and want to configure it to work with both Microsoft Windows XP, which is already installed, and Ubuntu or some other flavor of Linux. How can I do that without having to reinstall WinXP?

Question answered on December 27, 2008 at 08:22 AM :: Comments to date: 24

How can I unwrap or decode Web URL redirects?

I'm frustrated as heck! I clicked on a URL and next thing I knew I was on a completly different site that was quite, um, inappropriate for work. I know how to write a redirect in my own script, but I am wondering: how can I unwrap, decode, slow down or trace a sequence of redirects so I can see what's going on? If it helps, I have a Linux system I can use for the task.

Question answered on September 4, 2008 at 10:24 AM :: Comments to date: 1

How do I install Apple Developer Tools on my Mac?

Category: Mac OS X Help

I seem to recall a long time ago that when you installed Mac OS X you also got a bunch of cool Unix command line developer tools, including a C compiler, debugging tools and much more. I'm taking a C programming class at the local community college and would like to install these tools, but have no idea where they are any more. Help?

Question answered on March 1, 2008 at 08:57 AM :: Comments to date: 6

How do I step through numeric values in a shell script?

Please, gimme a advice how to correctly use loop "for i in `seq 1 10`" for Mac OS X, echo $SHELL->/bin/bash, because when I write simple strip: for i in `seq 1 10`;do echo $i;done it outputs -bash: seq: command not found.

Question answered on December 31, 2007 at 08:00 AM :: Comments to date: 3

What does the $( ) notation mean in a Bash script?

On page 329 (Hour 16) of your book Teach Yourself Unix in 24 Hours is the example:

value=3 ; string="my horse Horace"
test $value < $(echo $string | wc –c)
test `wc –l filename` -ge 10000

If I try this with this code:
#!/bin/sh/
value=3;string="my horse Horace"
test $value < $(echo $string | wc -c)
test `wc -l ched4` -ge 10000

I get:-
syntax error at line 3: `(' unexpected

Are you able to quickly explain what the line test $value < $(echo $string | wc -c) is actually trying to do? I don’t quite understand the $(…) part … and is the < performing a ‘redirection for input’ or is it meant to be ‘less than’?

Question answered on November 9, 2007 at 07:04 AM :: Comments to date: 2

How do I detect an iPhone user coming to my site?

Amazon.com's jumped on the wagon, and Meebo has too: they automatically give you a different version of their site if you're browsing from an Apple iPhone. I want to do that too. How the heck do I detect that a visitor has an iPhone?

Question answered on August 18, 2007 at 08:35 AM :: Comments to date: 44

How do I change my PS1 command prompt in Bash?

I have read about 15 chapters of your book (Teach Yourself UNIX in 24 Hours) so far. We are using vi. On the PS1 command, how do I see what is in it so I can add to it and not change what is already there? We are using bash. What I see now is: ctdaywbsdv:/u/gwilki$

When I enter ‘echo $PS1’ I get: $ \[\e[0m\]

How do I keep the above and add the histcmd option? What does the \e and 0m\ mean? What do the [] the square brackets mean? I can’t find a man page for PS1. How do I find the rest of the options for this PS1?

Question answered on July 6, 2007 at 07:39 AM :: Comments to date: 1

Article: Running Yellow Dog Linux on a Sony Playstation-3

In which we get the hottest video game system from Christmas 2006 and turn it into a Linux box? You bet!

If you're still thinking about video game systems as being just a wee bit more technologically advanced than an old Coleco or Atari 800, you've got quite a surprise coming the first time you crack open the proverbial hood. While the new Nintendo Wii (pronounced "wee", oddly enough) has some slick hardware, as does the Microsoft Xbox 360 device, the real winner in the technology race is the rather amazing Sony Playstation 3 system.

Built around an IBM Cell Broadband Engine processor, the PS3 includes a high def Blu-ray drive, four USB 2.0 ports, an Nvidia graphics processor with 256MB of separate video RAM, support for Compact Flash, SD and Memory Stick devices, Ethernet, built-in 802.11b and g, Bluetooth, an HDMI port and support for all the video resolutions you can imagine, including 480i, 480p, 720p, 1080i and the holy grail, 1080p. Sounds like a computer, not a video game system, doesn't it?

Question answered on March 14, 2007 at 07:13 AM :: Comments to date: 15

How do I get "vi" shell edit mode in Mac OS X Terminal?

I just finished Learning Unix for Mac OS X Tiger, and think it is an excellent little resource. I'm recently out of school, a school where we weren't taught anything about Unix, just enough to get by. I started work with the data converter team at Agilent labs, and have been able to glean quite a bit off of them (considering many of them were either directly or indirectly responsible for writing many of them commands in common use today). Thus, I'm often embarrassed to ask them questions about exactly some of the stuff you cover in the book.

Okay, now for the question: at work, they have the terminal set up such that the command line works like vi. That is, if I want to search my command history, I simply change mode via escape, type /pattern_to_be_searched, it finds the command, and then I can use other vi commands to change the command a little bit, and then execute it via the shell. How do I set this up in OS X?

Question answered on November 5, 2006 at 12:03 PM :: Comments to date: 2

How can my shell script test to see if it's already running?

I have a script that does an ftp from a SCO UNIX server to windows server to get files from the windows server. The script is set in the cron to run every xx minutes. Sometimes the script will hang and leave a process running. This can bog down the UNIX server. I want to be able to do two things. 1. I want to make sure that the script doesn't hang - so it should terminate after xx minutes (the files are very small that it is getting). And 2. I want the script to test to make sure that it is not already running, before starting again. THANKS

Question answered on October 27, 2006 at 07:42 AM :: Comments to date: 5

How can I count executable binaries on my Linux box?

I've been looking at your script to count executable binaries in the book Wicked Cool Shell Scripts and I think that there's a problem in the script. Specifically, what happens if I have a directory in my PATH more than once?

Question answered on October 25, 2006 at 08:30 AM :: Comments to date: 1

How can I time portions of a Linux shell script?

Just picked up your book Wicked Cool Shell Scripts and already have one quick question: While working on the startup scripts, I would like to place log timers at certain portions of scripts. Is it possible to log point A at he beginning of a section, do the processing, log point B at the end of the section and then log B minus A so I know exactly how long a section took to process?

Question answered on September 13, 2006 at 05:06 AM :: Comments to date: 10

Why is Mailman complaining "Site list is missing: mailman"?

I've been running the Python-based "mailman" mailing list management program for quite a while with good results, but all of a sudden when I try to start it up I get the error "Site list is missing: mailman" and it won't start. What the heck? How do I fix this?

Question answered on April 10, 2006 at 10:35 AM :: Comments to date: 3




Search
Find just the answers you seek from among our 3000+ tech support articles by using our Lijit search engine.

Help!
Need Help? Ask Dave Taylor!


Subscribe to
Ask Dave Taylor!

RDF XML
Add to My Yahoo!
Subscribe in NewsGator Online


Free Updates!
Sign up and get free tech support and special offers on books, seminars, workshops and more.



All Categories
Apple iPad Help
Articles and Reviews
Auctions and Online Shopping
Blogs and RSS Feeds
Building Web Site Traffic
Business and Management
CGI Scripts and Web Site Programming
Computer and Internet Basics
d) None of the Above
Facebook Help
Google Plus Help
HTML and CSS
Industry News and Trade Shows
iPhone and Cell Phone Help
iPod, Sony PSP and MP3 Player Help
Mac OS X Help
Pay Per Click (PPC) Advertising
Search Engine Optimization (SEO)
Shell Script Programming
Tech Support Video Help
The Writing Business
Twitter, LinkedIn and Social Network Help
Unix and Linux Help
Video Game Tips and Help
Windows PC Help
WordPress Help
Archives by Category
Apple iPad Help
Delete Keynote files from an iPad or iPhone?
How do I rearrange or move app icons on my iPhone / iPad?
How do I update the apps on my iPhone / iPad?


Articles and Reviews
Review: Sears Craftsman AssureLink 3043 Garage Door Opener
Review: iHome / New Balance Fitness Evolved Headphones
Smart Grids and Smart Homes: Part 2. Home Energy Management


Auctions and Online Shopping
Can I pre-order a music CD from the Apple iTunes Store?
How do I buy my friend an Amazon Gift Card?
Email Transaction Receipts for my PayPal Debit Card?


Blogs and RSS Feeds
Disable commenting on a Wordpress blog?
How do I add a new user on WordPress?
What topics and content should I include on my 3DS blog?


Building Web Site Traffic
Add Po.st Social Media (Facebook, Google Plus) widgets to your blog?
How do I claim a business on Google Places?
Visitor information and statistics from Google Analytics?


Business and Management
The Scoop on Merchant Services and Credit Card Processing?
How do I request money through Paypal?
How do I sell something on Amazon.com?


CGI Scripts and Web Site Programming
How do I identify direct, not referred, Website visitors?
How do I add an auto-print feature on my Web site/Blog?
How can I attractively embed mp3 audio files on my Web pages?


Computer and Internet Basics
Which wifi wireless network should I use?
How can I invite someone to join Pinterest?
How old does Google think I am?


d) None of the Above
Where's the closest pizza place?
Does the Unilever logo have a hidden message?
Easiest way to convert from one currency to another?


Facebook Help
How can I have Pinterest updates appear on Facebook?
Change Facebook "share" setting for update on iPhone?
Log out of Facebook on the iPhone?


Google Plus Help
Copy Picasa Web Photo Albums onto my Computer?
Post an iPhone photo to Google Plus?
Link my Web site to my new Google Plus Business Profile Page?


HTML and CSS
Add Po.st Social Media (Facebook, Google Plus) widgets to your blog?
Boxes around words or sentences with CSS?
How do I implement add rel=author for Google serps?


Industry News and Trade Shows
The 2012 Consumer Electronics Show: Trip Report
Dave's Best of the 2012 Consumer Electronics Show
Trade show report: CTIA 2011


iPhone and Cell Phone Help
Resign from Words with Friends game?
How do I copy voice memos off my iPhone 4s?
Establish time limits on my son's AT&T Wireless cell phone?


iPod, Sony PSP and MP3 Player Help
Can I remove songs from an unsync'd iPod Touch?
Get started with iTunes Match!
Can I pre-order a music CD from the Apple iTunes Store?


Mac OS X Help
How can I pair a bluetooth speaker with my MacBook Pro?
Which wifi wireless network should I use?
How can you hack the LocalDictionary on a Mac system?


Pay Per Click (PPC) Advertising
Add Po.st Social Media (Facebook, Google Plus) widgets to your blog?
How is CPM calculated on Google AdWords YouTube Video?
How do I connect my Google AdSense and Analytics accounts?


Search Engine Optimization (SEO)
Change in Web site navigation drops PageRank to zero?
How do I implement add rel=author for Google serps?
Add a new site to my Google Webmaster Tools account?


Shell Script Programming
Parsing "id" strings in a Shell Script?
Copy and Paste from the Mac OS X Command Line?
Script to test line lengths for Twitter compatibility?


Tech Support Video Help
Introduction to Google Docs Spreadsheets
How to Create a Video Greeting on your Mac
How to Create a Video Greeting Card on your PC


The Writing Business
What's the best option for self-publishing my book?
How do I get into online writing?
How do I recover a lost ISBN book number?


Twitter, LinkedIn and Social Network Help
How do I change my YouTube account profile picture?
How can my Pinterest pins link to specific Web page URLs?
Post URLs to LinkedIn as status updates?


Unix and Linux Help
Install Ubuntu Linux within Parallels Desktop on Mac?
Copy and Paste from the Mac OS X Command Line?
Shell script to convert lowercase to title case?


Video Game Tips and Help
Resign from Words with Friends game?
Connect my Nintendo 3DS to the Internet via wifi?
Runescape - Level 3 - New Player's Guide


Windows PC Help
Is my copy of Windows 7 "activated" and genuine?
How can I change my Windows PC computer name?
Can I read Kindle ebooks on my Apple MacBook or Windows PC?


WordPress Help
RSS Graffiti can't publish my feed: "missing publication date"?


Tech Media Network publisher
"Ask Dave Taylor®" is a registered trademark of Intuitive Systems, LLC.
All Rights Reserved.