Salva retorno do sistema
Publicado por Perfil removido (última atualização em 11/01/2010)
[ Hits: 4.427 ]
É um pequeno script que se encarrega de salvar o retorno de algum comando dado para você em um arquivo que você escolhe.
Muito útil para quem vai examinar um log, por exemplo, e não pode dar um crtl+F. :)
Você teria que copiar e colar, mas o script faz isso por você.
Espero que gostem, caso tenham alguma sugestão, podem mandar.
Abraço.
// save_system_return.c // // Copyright 2010 Orlando Xavier <ox@orlandoxavier> // // This program is free software; you can redistribute it and/or modify // it under the terms of the GNU General Public License as published by // the Free Software Foundation; either version 2 of the License, or // (at your option) any later version. // // This program is distributed in the hope that it will be useful, // but WITHOUT ANY WARRANTY; without even the implied warranty of // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the // GNU General Public License for more details. // // You should have received a copy of the GNU General Public License // along with this program; if not, write to the Free Software // Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, // MA 02110-1301, USA. #include <stdio.h> #include <stdlib.h> #include <string.h> int main(int argc, char** argv) { char cmd[255]; char nome_arq[255], diretorio[255]; char param_cmd[255], param_nome_dir[255], param_touch[255], param_grava[255]; printf("Comando do Shell: "); gets(cmd); printf("Nome do arquivo seguido da extensao: "); gets(nome_arq); printf("Caminho do diretorio: "); gets(diretorio); sprintf(param_nome_dir, "%s %s", nome_arq, diretorio); system(param_nome_dir); sprintf(param_touch, "touch %s", param_nome_dir); system(param_touch); sprintf(param_cmd, "%s", cmd); system(param_cmd); sprintf(param_grava, "%s >> %s", param_cmd, param_nome_dir); system(param_grava); return(0); }
Lista duplamente encadeada com cabecalho
Nenhum comentário foi encontrado.
Atenção a quem posta conteúdo de dicas, scripts e tal (6)
O mínimo que você precisa saber sobre o terminal (parte 2)
O mínimo que você precisa saber sobre o terminal (parte 1)
Como iniciar uma máquina virtual do VirtualBox automaticamente no boot do LUbuntu 18 LTS
Os navegadores "leves" que de leves não tem nada
Liberte-se: Crie um Servidor Proxy na Nuvem para Acessar Conteúdos Bloqueados
Fedora Kinoite 40 — Instalação de drivers NVIDIA e Xorg
Deixando o Opensuse Tumbleweed com KDE bonitão
Estrutura de recuo PHP/Apache para não acessarem arquivos pela URI (barra de endereços)
Escanear a rede com NBTSCAN para descobrir IPs e nomes de computadores
Como instalar ou remover ambientes gráficos facilmente no openSUSE
Icone da rede fica com sinal em zero porcento após conectado[DUV... (1)
como eu iinstalo o chromeos em uma cartão sd (21)
Criando partiçoes no HD com swap reservada de no máximo 1GB[AJUDA] (21)