Use the below sed command to delete the Header record. i – Replace the original file1d – delete the first record in the file Use the below sed command to delete the footer record. i – Replace the original file$d – delete the last record in the file Use the below sed command to delete… Continue reading How to remove header and footer records of a flat file using UNIX shell script?
Category: Shell Scripting
How to add header record to a flat file using unix shell script
Add header to a file using SED command The below sed command will update the original file and insert the header before the first line of the file. 2. Add header to a file using AWK command The below awk command will add header and create a new file. The BEGIN statement in awk makes… Continue reading How to add header record to a flat file using unix shell script
Execute multiple shell commands from a single command task in Informatica BDM
How to run multiple shell commands from a single command task in Informatica BDM. Just separate the commands with a semi colon, The integration service will execute the commands in the given order. One thing to note here, If you run multiple commands like this, the script output will be from the last shell commands… Continue reading Execute multiple shell commands from a single command task in Informatica BDM
Execute Shell script using command task in Informatica BDM
How to Execute Shell script in Informatica BDM using command task. Most of the file operations and other functionalities can be done through a shell script quickly and informatica is providing an option to execute the shell script using a command task. Let’s see how to do that by taking an example. I have a… Continue reading Execute Shell script using command task in Informatica BDM
How to get the counts of deleted files in unix/linux
How to get the counts of deleted files in unix/linux If you want to get the deleted files count by your rm command, use the verbose option (-v) and wc -l. To delete a file rm -f source_fname_*.txt To get the counts of deleted files rm -vf source_fname_*.txt | wc -l To find & delete… Continue reading How to get the counts of deleted files in unix/linux
How to find all writable files by a specific user in unix
Linux find command to list all files writable by a specific user To find all writable files in current directory that are writable by the current user: use the command writable find . -writable To find all writable files in a specific directory that are writable by the specific user: find {file_path} -writable -user {user_id}… Continue reading How to find all writable files by a specific user in unix
How to get only filename from find command in Linux?
How to get only filename from find command in Linux? Normally find command will retrieve the filename and its path as one string. If you want to display only the filename, you can use basename command. find {file_path} -type f -iname {file_pattern} -exec basename {} ; find infa/bdm/server/source/path -type f -iname “source_fname_*.txt” -exec basename {} ; Search tags! How do I… Continue reading How to get only filename from find command in Linux?
How to Exclude All “Permission denied” messages When Using Find Command?
How to Exclude All “Permission denied” messages When Using Find Command in UNIX/LINUX? use 2>/dev/null The 2>/dev/null at the end of the find command tells your shell to redirect the standard error messages to /dev/null, so you won’t see them on screen. “/dev/null” is a virtual device file, Whatever you write to “/dev/null” will be… Continue reading How to Exclude All “Permission denied” messages When Using Find Command?