How to create nodes from shell script at server?
If you are going to start scripting on the command line, you can always script a php script and run it via drush. That way, you have access to your Drupal system and data. For example, if you place the following code in a file, e.g. script_create_node.php:  

&lt;?php

// Expect title as $args[1] and body as $args[2]
if( !isset($args[1]) || trim($args[1]) == '' || !isset($args[2]) || trim($args[2]) == '') {
  print "Expecting two arguments on the command line, title and body, for the new article\n";
  exit;
}

$node = new stdClass();  // Create a new node object
$node-&gt;type = 'article';  // Content type
$node-&gt;language = LANGUAGE_NONE;  // Or e.g. 'en' if locale is enabled
node_object_prepare($node);  //Set some default values

$node-&gt;title = $args[1];
$node-&gt;body[$node-&gt;language][0]['value'] = $args[2];

$node-&gt;status = 1;   // (1 or 0): published or unpublished
$node-&gt;promote = 0;  // (1 or 0): promoted to front page or not
$node-&gt;sticky = 0;  // (1 or 0): sticky at top of lists or not
$node-&gt;comment = 1;  // 2 = comments open, 1 = comments closed, 0 = comments hidden
// Add author of the node
$node-&gt;uid = 1;

// Save the node
node_save($node);


you can always call this on the terminal like this:

drush scr script_create_node.php "Article Title" "Article Body"


You can extend such a script to include the logic you would use in your shell script, but instead of writing to a CSV file, you can write directly to the database. It's a great advantage having both PHP-CLI and a bootstrapped Drupal available at the same time.

Hope this helps some!

P.S: Lots of pages out there answering the question "programmatically creating nodes", one random pick would be http://www.group42.ca/creating_and_updating_nodes_programmatically_in_drupal_7