Sponsored Content
Top Forums Shell Programming and Scripting Bash to select and save file in new directory Post 302975801 by RudiC on Sunday 19th of June 2016 04:54:37 AM
Old 06-19-2016
How about (ad[ao]pting Aia's proposal):

Code:
PS3="please select a file to analyze with entered gene or genes (or 1 or q to quit): "
select ANSW in  exit /mnt/9/playground/*
                    do  case $REPLY in 1|[eq]*) break;; esac
                        echo $ANSW "will be used to filter reads, identify target bases and genes less than 20 and 30 reads, create a low coverage bed for vizulization, and calcul
                        echo "Start selected file creation: Panel: ${FUNCNAME[0]} Date: $(date) - File: $ANSW"
                        file=${ANSW##*/}
                        echo mv -v "$ANSW" /mnt/9/playground/LA/${file%.jpg}_OTHER.txt ;    
                        echo "End selected file creation: $(date) - File: $ANSW"
                    done | tee LOG


Last edited by RudiC; 06-19-2016 at 06:00 AM..
 

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

[bash] redirect (save) array to a file

Hi, I'm trying to write a function that redirects the contents of an array to a file. The array contains the lines of a data file with white space. The function seems to preserve all white space when redirected except that it seems to ignore newlines. As a consequence, the elements of the... (7 Replies)
Discussion started by: ASGR
7 Replies

2. Shell Programming and Scripting

select data from oracle table and save the output as csv file

Hi I need to execute a select statement in a solaris environment with oracle database. The select statement returns number of rows of data. I need the data to be inserted into a CSV file with proper format. For that we normally use "You have to select all your columns as one big string,... (2 Replies)
Discussion started by: rdhanek
2 Replies

3. Shell Programming and Scripting

Save output into file bash scripting

Hi there. i have created a program that in the end it will give output like this 1 2 3 4 5 10 9 8 7 6 11 12 13 14 15 .............. 17 i wonder how to save the output into a single string and into a file. i.e 1 10 11 12 9 2 3 8 13 14 7 4 5 6 15 17 (in this order,... (3 Replies)
Discussion started by: shdin271
3 Replies

4. Homework & Coursework Questions

Save output into file bash scripting

Use and complete the template provided. The entire template must be completed. If you don't, your post may be deleted! 1. The problem statement, all variables and given/known data: Hi there. i have created a program that in the end it will give output like this 1 2 3 4 5 10 9 ... (1 Reply)
Discussion started by: shdin271
1 Replies

5. Shell Programming and Scripting

Bash to select panel then specific file in directory

I am using bash to prompt a user for a choice using: where a "y" response opens a menu with available panels that can be used. while true; do read -p "Do you want to get coverage of a specific panel?" yn case $yn in * ) menu; break;; * ) exit;; * ) echo... (6 Replies)
Discussion started by: cmccabe
6 Replies

6. Shell Programming and Scripting

Bash to select oldest folder in directory automatically and log process

The `bash` below uses the oldest folder in the specified directory and logs it. The goes though an analysis process and creates a log. My problem is that if there are 3 folders in the directory folder1,folder2,folder3, the bash is using folder2 for the analysis eventhough folder1 is the oldest... (0 Replies)
Discussion started by: cmccabe
0 Replies

7. Shell Programming and Scripting

Bash to select text and apply it to a selected file in bash

In the bash below I am asking the user for a panel and reading that into bed. Then asking the user for a file and reading that into file1.Is the grep in bold the correct way to apply the selected panel to the file? I am getting a syntax error. Thank you :) ... (4 Replies)
Discussion started by: cmccabe
4 Replies

8. Shell Programming and Scripting

Bash to select oldest folder in directory and write to log

In the bash below the oldest folder in a directory is selected. If there are 3folders in the directory /home/cmccabe/Desktop/NGS/test and nothing is done to them (ie. no files deleted, renamed) then the bash correctly identifies f1 as the oldest. However, if something is done to the folder then... (4 Replies)
Discussion started by: cmccabe
4 Replies

9. UNIX for Beginners Questions & Answers

Unset array element and save to file in Bash

#!/bin/bash X=(2H 4S 10D QC JD 9H 8S) How do I unset the 10D from this array and save it to a file? Please use CODE tags as required by forum rules! (5 Replies)
Discussion started by: cogiz
5 Replies
DATETIME.SETTIME(3)							 1						       DATETIME.SETTIME(3)

DateTime::setTime - Sets the time

       Object oriented style

SYNOPSIS
public DateTime DateTime::setTime (int $hour, int $minute, [int $second]) DESCRIPTION
Procedural style DateTime date_time_set (DateTime $object, int $hour, int $minute, [int $second]) Resets the current time of the DateTime object to a different time. PARAMETERS
o $object -Procedural style only: A DateTime object returned by date_create(3). The function modifies this object. o $hour - Hour of the time. o $minute - Minute of the time. o $second - Second of the time. RETURN VALUES
Returns the DateTime object for method chaining or FALSE on failure. CHANGELOG
+--------+---------------------------------------------------+ |Version | | | | | | | Description | | | | +--------+---------------------------------------------------+ | 5.3.0 | | | | | | | Changed the return value on success from NULL to | | | DateTime. | | | | +--------+---------------------------------------------------+ EXAMPLES
Example #1 DateTime.setTime(3) example Object oriented style <?php $date = new DateTime('2001-01-01'); $date->setTime(14, 55); echo $date->format('Y-m-d H:i:s') . " "; $date->setTime(14, 55, 24); echo $date->format('Y-m-d H:i:s') . " "; ?> Procedural style <?php $date = date_create('2001-01-01'); date_time_set($date, 14, 55); echo date_format($date, 'Y-m-d H:i:s') . " "; date_time_set($date, 14, 55, 24); echo date_format($date, 'Y-m-d H:i:s') . " "; ?> The above examples will output something similar to: 2001-01-01 14:55:00 2001-01-01 14:55:24 Example #2 Values exceeding ranges are added to their parent values <?php $date = new DateTime('2001-01-01'); $date->setTime(14, 55, 24); echo $date->format('Y-m-d H:i:s') . " "; $date->setTime(14, 55, 65); echo $date->format('Y-m-d H:i:s') . " "; $date->setTime(14, 65, 24); echo $date->format('Y-m-d H:i:s') . " "; $date->setTime(25, 55, 24); echo $date->format('Y-m-d H:i:s') . " "; ?> The above example will output: 2001-01-01 14:55:24 2001-01-01 14:56:05 2001-01-01 15:05:24 2001-01-02 01:55:24 SEE ALSO
DateTime.setDate(3), DateTime.setISODate(3). PHP Documentation Group DATETIME.SETTIME(3)
All times are GMT -4. The time now is 04:14 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy